fix: pad the auth code

This commit is contained in:
Richard Ramos 2022-12-07 17:35:03 -04:00
parent a6c9f857e4
commit 200ae58a6d
No known key found for this signature in database
GPG Key ID: BD36D48BC9FFC88C

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();
}