fix: pad the auth code

This commit is contained in:
Richard Ramos 2022-12-07 17:35:03 -04:00 committed by RichΛrd
parent e9e19b80a8
commit c10e2f1a88
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ export class Handshake {
genAuthcode(): string {
const output0 = getHKDFRaw(this.hs.ss.h, new Uint8Array(), 8);
const bn = new BN(output0);
const code = bn.mod(new BN(100_000_000));
const code = bn.mod(new BN(100_000_000)).toString().padStart(8, "0");
return code.toString();
}