libwebp-compress/testCOut/pre.js
2025-11-27 15:32:16 +08:00

11 lines
353 B
JavaScript

// Adapted from the Emscripten error message when initialising std::random_device
var crypto = globalThis?.crypto || {
getRandomValues: array => {
// Cryptographically insecure, but fine for audio
for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0;
}
};
var performance = globalThis?.performance || {
now: _ => Date.now()
};