Merge pull request #285 from bartbutler/master
Comparison fix for broken getRandomBigIntegerInRange function
This commit is contained in:
commit
1cc3f4fe2e
|
@ -124,7 +124,7 @@ module.exports = {
|
|||
|
||||
var range = max.subtract(min);
|
||||
var r = this.getRandomBigInteger(range.bitLength());
|
||||
while (r > range) {
|
||||
while (r.compareTo(range) > 0) {
|
||||
r = this.getRandomBigInteger(range.bitLength());
|
||||
}
|
||||
return min.add(r);
|
||||
|
|
Loading…
Reference in New Issue
Block a user