utils: fix getRandomInt()

This commit is contained in:
Micooz 2017-08-29 11:35:54 +08:00
parent 14484038e6
commit e4043ea1b2
No known key found for this signature in database
GPG Key ID: 002FB5DD584D6CB1

@ -77,7 +77,7 @@ export function parseURI(uri) {
export function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.ceil(max);
return Math.floor(crypto.randomBytes(1)[0] / 0xff * (max - min + 1)) + min;
return Math.floor(crypto.randomBytes(1)[0] / 0xff * (max - min)) + min;
}
/**