We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ad14217 + 6ef46fd commit 600bc55Copy full SHA for 600bc55
src/rngs/os.rs
@@ -1023,9 +1023,9 @@ mod imp {
1023
let result = js! {
1024
try {
1025
if (
1026
- typeof window === "object" &&
1027
- typeof window.crypto === "object" &&
1028
- typeof window.crypto.getRandomValues === "function"
+ typeof self === "object" &&
+ typeof self.crypto === "object" &&
+ typeof self.crypto.getRandomValues === "function"
1029
) {
1030
return { success: true, ty: 1 };
1031
}
@@ -1063,7 +1063,7 @@ mod imp {
1063
OsRngMethod::Browser => js! {
1064
1065
let array = new Uint8Array(@{ len });
1066
- window.crypto.getRandomValues(array);
+ self.crypto.getRandomValues(array);
1067
HEAPU8.set(array, @{ ptr });
1068
1069
return { success: true };
0 commit comments