From c10e2f1a88de0b85d6748f0f196a16ad64238bea Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 7 Dec 2022 17:35:03 -0400 Subject: [PATCH] fix: pad the auth code --- src/handshake.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handshake.ts b/src/handshake.ts index 6d16142..7a0f5be 100644 --- a/src/handshake.ts +++ b/src/handshake.ts @@ -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(); }