From 9ca82e43984ae8a0b0df99f808d508df52467c28 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 04:55:24 -0800 Subject: [PATCH] Tweak some var names for clarity of intent. --- src/lib/account.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/account.ts b/src/lib/account.ts index 8c1d94b..a1be067 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -240,13 +240,12 @@ export class Account { return bytes.toHex(publicKeyBytes) } - static #keyToAddress (key: string): string { - const publicKeyBytes = hex.toBytes(key) - const checksum = new Blake2b(5).update(publicKeyBytes).digest() - checksum.reverse() - const encoded = bytes.toBase32(publicKeyBytes) - const encodedChecksum = bytes.toBase32(checksum) - return `${PREFIX}${encoded}${encodedChecksum}` + static #keyToAddress (publicKey: string): string { + const publicKeyBytes = hex.toBytes(publicKey) + const checksumBytes = new Blake2b(5).update(publicKeyBytes).digest().reverse() + const encodedPublicKey = bytes.toBase32(publicKeyBytes) + const encodedChecksum = bytes.toBase32(checksumBytes) + return `${PREFIX}${encodedPublicKey}${encodedChecksum}` } static #validateKey (key: string): void { -- 2.34.1