Fix random int in workers

This commit is contained in:
Fabian 2021-01-03 17:18:46 -06:00
parent 69e0a319b6
commit b1fdd5640b

View file

@ -78,13 +78,13 @@ function h(n, len)
}
if(typeof window !== "undefined" && window.crypto && window.crypto.getRandomValues)
if(typeof crypto !== "undefined" && crypto.getRandomValues)
{
let rand_data = new Int32Array(1);
v86util.get_rand_int = function()
{
window.crypto.getRandomValues(rand_data);
crypto.getRandomValues(rand_data);
return rand_data[0];
};
}