this is just in case you want to attach a better/different algo to get numbers.
const crypto = require('crypto')
const getRandom = (min, max) => {
let number
const range = max - min + 1
do
{
const buffer = crypto.randomBytes(4)
number = buffer.readUInt8(0)
console.log(number)
}
while (number >= Number.MAX_VALUE - (Number.MAX_VALUE % range))
number %= range
return number + min
}
this is just in case you want to attach a better/different algo to get numbers.
Signed-off-by: Marco Casula mc@clickbit.net