From 23be3b1e41e09793647d8ff68159f39050ccce3e Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 05:09:47 -0800 Subject: [PATCH] Tweak var names for clarity of intent. --- src/lib/account.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/account.ts b/src/lib/account.ts index 114662e..f85b2eb 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -230,9 +230,8 @@ export class Account { static #addressToKey (v: string): string { const publicKeyBytes = base32.toBytes(v.slice(-60, -8)) const checksumBytes = base32.toBytes(v.slice(-8)) - const blakeHash = new Blake2b(5).update(publicKeyBytes).digest() - blakeHash.reverse() - if (bytes.toHex(checksumBytes) !== bytes.toHex(blakeHash)) { + const rechecksumBytes = new Blake2b(5).update(publicKeyBytes).digest().reverse() + if (bytes.toHex(checksumBytes) !== bytes.toHex(rechecksumBytes)) { throw new Error('Checksum mismatch in address') } return bytes.toHex(publicKeyBytes) -- 2.34.1