|
|
@ -17,12 +17,12 @@ const binaryToBytes = binaryString => Buffer.from( |
|
|
|
.map(binary => parseInt(binary, 2)) |
|
|
|
); |
|
|
|
|
|
|
|
const randomNumberBetween = (min, max) => Math.floor(parseInt(randomBytes(1).toString('hex'), 16) / 256 * (max - min + 1) + min); |
|
|
|
const randomNumberBetween = (min, max) => Math.floor((parseInt(randomBytes(1).toString('hex'), 16) / 256 * (max - min + 1)) + min); |
|
|
|
|
|
|
|
const dogeSeed = (bits) => { |
|
|
|
const dogeSeed = bits => { |
|
|
|
bits = bits || 128; |
|
|
|
if (bits <= 0 || bits % 8 !== 0) { |
|
|
|
throw TypeError('bits must be divisible by 8'); |
|
|
|
throw new TypeError('bits must be divisible by 8'); |
|
|
|
} |
|
|
|
|
|
|
|
const entropy = randomBytes(bits / 8); |
|
|
|