Wasm working again for node
needs testing in browser
This commit is contained in:
@@ -201,14 +201,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (!global.crypto && global.require) {
|
||||
const nodeCrypto = require("crypto");
|
||||
global.crypto = {
|
||||
getRandomValues(b) {
|
||||
nodeCrypto.randomFillSync(b);
|
||||
},
|
||||
};
|
||||
}
|
||||
// if (!global.crypto && global.require) {
|
||||
// const nodeCrypto = require("crypto");
|
||||
// global.crypto = {
|
||||
// getRandomValues(b) {
|
||||
// nodeCrypto.randomFillSync(b);
|
||||
// },
|
||||
// };
|
||||
// }
|
||||
if (!global.crypto) {
|
||||
throw new Error("global.crypto is not available, polyfill required (getRandomValues only)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user