From b1fdd5640b293a536fc9048299674da97fffd4d1 Mon Sep 17 00:00:00 2001 From: Fabian Date: Sun, 3 Jan 2021 17:18:46 -0600 Subject: [PATCH] Fix random int in workers --- src/lib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.js b/src/lib.js index e8b1736f..ebeaf016 100644 --- a/src/lib.js +++ b/src/lib.js @@ -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]; }; }