[PM-8857] fix passphrase missing number (#9634)

This commit is contained in:
✨ Audrey ✨ 2024-06-14 13:19:51 -04:00 committed by GitHub
parent 6e7239e05e
commit 44b5971458
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ export class PassphraseGeneratorStrategy
// select which word gets the number, if any
let luckyNumber = -1;
if (o.includeNumber) {
luckyNumber = await this.randomizer.uniform(0, o.numWords);
luckyNumber = await this.randomizer.uniform(0, o.numWords - 1);
}
// generate the passphrase

View File

@ -47,7 +47,7 @@ export class PassphraseGeneratorStrategy
// select which word gets the number, if any
let luckyNumber = -1;
if (o.includeNumber) {
luckyNumber = await this.randomizer.uniform(0, o.numWords);
luckyNumber = await this.randomizer.uniform(0, o.numWords - 1);
}
// generate the passphrase