utils: fix getRandomInt()
This commit is contained in:
parent
14484038e6
commit
e4043ea1b2
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user