]> zoso.dev Git - libnemo.git/commitdiff
Tweak var names for clarity of intent.
authorChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 13:09:47 +0000 (05:09 -0800)
committerChris Duncan <chris@zoso.dev>
Tue, 3 Dec 2024 13:09:47 +0000 (05:09 -0800)
src/lib/account.ts

index 114662ec5fe2b27d17494087e52bab7448432232..f85b2ebd5e049dab5d6be84124020c60d97a76f1 100644 (file)
@@ -230,9 +230,8 @@ export class Account {
        static #addressToKey (v: string): string {\r
                const publicKeyBytes = base32.toBytes(v.slice(-60, -8))\r
                const checksumBytes = base32.toBytes(v.slice(-8))\r
-               const blakeHash = new Blake2b(5).update(publicKeyBytes).digest()\r
-               blakeHash.reverse()\r
-               if (bytes.toHex(checksumBytes) !== bytes.toHex(blakeHash)) {\r
+               const rechecksumBytes = new Blake2b(5).update(publicKeyBytes).digest().reverse()\r
+               if (bytes.toHex(checksumBytes) !== bytes.toHex(rechecksumBytes)) {\r
                        throw new Error('Checksum mismatch in address')\r
                }\r
                return bytes.toHex(publicKeyBytes)\r