From b0d7fc14b1029d5b79765e2f81eda190c2935fca Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 6 Sep 2016 18:21:14 -0700 Subject: [PATCH] random: optimize fallback. --- lib/crypto/random.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/crypto/random.js b/lib/crypto/random.js index 910b2ee1..ea1af3b8 100644 --- a/lib/crypto/random.js +++ b/lib/crypto/random.js @@ -48,7 +48,7 @@ if (crypto) { var i; for (i = 0; i < data.length; i++) - data[i] = ((Math.random() * 0x100000000) >>> 0) % 256; + data[i] = Math.floor(Math.random() * 256); return data; };