You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only use the node fallback code when its actually needed, otherwise
assume that `crypto.getRandomValues` is available out-of-the-box (which
it is on node v19 and above.
// we couldn't find a proper implementation, as Math.random() is not
581
-
// suitable for /dev/random, see emscripten-core/emscripten/pull/7096
582
-
#if ASSERTIONS
583
-
abort('no cryptographic support found for random function. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: (array) => { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };');
572
+
#if SHARED_MEMORY
573
+
// like with most Web APIs, we can't use Web Crypto API directly on shared memory,
574
+
// so we need to create an intermediate buffer and copy it to the destination
0 commit comments