mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-06-12 09:06:50 +00:00
Need to use compareTo when comparing BigIntegers, otherwise get a string comparison with lexical order
This commit is contained in:
parent
168b184a1a
commit
0ce32bec92
@ -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…
x
Reference in New Issue
Block a user