From: Chris Duncan Date: Tue, 3 Dec 2024 13:09:47 +0000 (-0800) Subject: Tweak var names for clarity of intent. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=23be3b1e41e09793647d8ff68159f39050ccce3e;p=libnemo.git Tweak var names for clarity of intent. --- 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)