throw new RangeError('Invalid interval')
}
max = Math.floor(max)
- if (min != null && min !== 0) {
+ if (min !== 0) {
min = Math.ceil(min)
return Math.floor(secureRandom() * (max - min + 1)) + min
}
throw new RangeError('Invalid interval')
}
max = Math.floor(max)
- if (min != null && min !== 0) {
+ if (min !== 0) {
min = Math.ceil(min)
return Math.floor(secureRandomWithRandomValues() * (max - min + 1)) + min
}
throw new RangeError('Invalid interval')
}
max = Math.floor(max)
- if (min != null && min !== 0) {
+ if (min !== 0) {
min = Math.ceil(min)
return Math.floor(Math.random() * (max - min + 1)) + min
}
),
Benchmark.add('Crypto random integer generator', (max = maximum, min = 0) => {
max = Math.floor(max)
- if (min != null && min !== 0) {
+ if (min !== 0) {
min = Math.ceil(min)
return Math.floor(randomInt(min, max + 1))
}