From eabf29316bd08f2d43a93a53cd26ced312c42603 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Wed, 4 Dec 2024 11:57:33 -0800 Subject: [PATCH] Use scoped declarations instead of var. --- src/lib/nano-nacl.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/nano-nacl.ts b/src/lib/nano-nacl.ts index 5f5b651..c395974 100644 --- a/src/lib/nano-nacl.ts +++ b/src/lib/nano-nacl.ts @@ -836,11 +836,10 @@ const n = () => { throw new Error('bad signature size') if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) throw new Error('bad public key size') - var sm = new Uint8Array(crypto_sign_BYTES + msg.length) - var m = new Uint8Array(crypto_sign_BYTES + msg.length) - var i - for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i] - for (i = 0; i < msg.length; i++) sm[i + crypto_sign_BYTES] = msg[i] + const sm = new Uint8Array(crypto_sign_BYTES + msg.length) + const m = new Uint8Array(crypto_sign_BYTES + msg.length) + for (let i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i] + for (let i = 0; i < msg.length; i++) sm[i + crypto_sign_BYTES] = msg[i] return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0) } -- 2.34.1