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