Wasm working again for node

needs testing in browser
This commit is contained in:
Felix Kaspar
2023-11-15 00:24:04 +01:00
parent 063acc6bbf
commit 997f0f349d
6 changed files with 903 additions and 21 deletions

View File

@@ -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)");
}