mirror of
https://github.com/logos-messaging/js-noise.git
synced 2026-01-02 13:43:08 +00:00
fix: pad the auth code
This commit is contained in:
parent
e9e19b80a8
commit
c10e2f1a88
@ -174,7 +174,7 @@ export class Handshake {
|
|||||||
genAuthcode(): string {
|
genAuthcode(): string {
|
||||||
const output0 = getHKDFRaw(this.hs.ss.h, new Uint8Array(), 8);
|
const output0 = getHKDFRaw(this.hs.ss.h, new Uint8Array(), 8);
|
||||||
const bn = new BN(output0);
|
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();
|
return code.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user