From 3cdd8c3b22ed9a61d18d5e583a6bd7d2e9c50d43 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Thu, 22 Nov 2018 06:34:20 +0700 Subject: [PATCH] Don't infer 128 bits from falsey bit value --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 814ac29..245d3b6 100644 --- a/src/index.js +++ b/src/index.js @@ -20,7 +20,7 @@ const binaryToBytes = binaryString => Buffer.from( const randomNumberBetween = (min, max) => Math.floor((parseInt(randomBytes(1).toString('hex'), 16) / 256 * (max - min + 1)) + min); const dogeSeed = bits => { - bits = bits || 128; + bits = typeof bits === 'undefined' ? 128 : bits; if (bits <= 0 || bits % 8 !== 0) { throw new TypeError('bits must be divisible by 8'); }