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

index 8c1d94b3867833ce676543ab0c8a73456cbb1343..a1be067f9bec19c1eaa271393b60e25b7ae1eb39 100644 (file)
@@ -240,13 +240,12 @@ export class Account {
                return bytes.toHex(publicKeyBytes)\r
        }\r
 \r
-       static #keyToAddress (key: string): string {\r
-               const publicKeyBytes = hex.toBytes(key)\r
-               const checksum = new Blake2b(5).update(publicKeyBytes).digest()\r
-               checksum.reverse()\r
-               const encoded = bytes.toBase32(publicKeyBytes)\r
-               const encodedChecksum = bytes.toBase32(checksum)\r
-               return `${PREFIX}${encoded}${encodedChecksum}`\r
+       static #keyToAddress (publicKey: string): string {\r
+               const publicKeyBytes = hex.toBytes(publicKey)\r
+               const checksumBytes = new Blake2b(5).update(publicKeyBytes).digest().reverse()\r
+               const encodedPublicKey = bytes.toBase32(publicKeyBytes)\r
+               const encodedChecksum = bytes.toBase32(checksumBytes)\r
+               return `${PREFIX}${encodedPublicKey}${encodedChecksum}`\r
        }\r
 \r
        static #validateKey (key: string): void {\r