From: Chris Duncan Date: Tue, 19 Nov 2024 06:58:25 +0000 (-0800) Subject: Newlines for legibility. X-Git-Tag: v0.0.20~9 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=fbe7d490e1438083ad1cb70fa2d29b2dd2af536f;p=libnemo.git Newlines for legibility. --- diff --git a/src/lib/account.ts b/src/lib/account.ts index d01a988..1f54c92 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -143,7 +143,8 @@ export class Account { const expectedChecksum = address.slice(-8) const keyBase32 = address.slice(address.indexOf('_') + 1, -8) const keyBuf = base32.toBytes(keyBase32) - const actualChecksumBuf = blake2b(5, undefined, undefined, undefined, true).update(keyBuf).digest().reverse() + const actualChecksumBuf = blake2b(5, undefined, undefined, undefined, true) + .update(keyBuf).digest().reverse() const actualChecksum = bytes.toBase32(actualChecksumBuf) if (expectedChecksum !== actualChecksum) { @@ -186,7 +187,8 @@ export class Account { static #addressToKey (v: string): string { const keyBytes = base32.toBytes(v.substring(0, 52)) const checksumBytes = base32.toBytes(v.substring(52, 60)) - const blakeHash = blake2b(5, undefined, undefined, undefined, true).update(keyBytes).digest().reverse() + const blakeHash = blake2b(5, undefined, undefined, undefined, true) + .update(keyBytes).digest().reverse() if (bytes.toHex(checksumBytes) !== bytes.toHex(blakeHash)) { throw new Error('Checksum mismatch in address') } @@ -195,7 +197,8 @@ export class Account { static async #keyToAddress (key: string): Promise { const publicKeyBytes = hex.toBytes(key) - const checksum = blake2b(5, undefined, undefined, undefined, true).update(publicKeyBytes).digest().reverse() + const checksum = blake2b(5, undefined, undefined, undefined, true) + .update(publicKeyBytes).digest().reverse() const encoded = bytes.toBase32(publicKeyBytes) const encodedChecksum = bytes.toBase32(checksum) return `${PREFIX}${encoded}${encodedChecksum}`