Browse Source

Don't infer 128 bits from falsey bit value

pull/2/head
Luke Childs 6 years ago
parent
commit
3cdd8c3b22
  1. 2
      src/index.js

2
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');
}

Loading…
Cancel
Save