const expectedChecksum = address.slice(-8)\r
const keyBase32 = address.slice(address.indexOf('_') + 1, -8)\r
const keyBuf = base32.toBytes(keyBase32)\r
- const actualChecksumBuf = blake2b(5, undefined, undefined, undefined, true).update(keyBuf).digest().reverse()\r
+ const actualChecksumBuf = blake2b(5, undefined, undefined, undefined, true)\r
+ .update(keyBuf).digest().reverse()\r
const actualChecksum = bytes.toBase32(actualChecksumBuf)\r
\r
if (expectedChecksum !== actualChecksum) {\r
static #addressToKey (v: string): string {\r
const keyBytes = base32.toBytes(v.substring(0, 52))\r
const checksumBytes = base32.toBytes(v.substring(52, 60))\r
- const blakeHash = blake2b(5, undefined, undefined, undefined, true).update(keyBytes).digest().reverse()\r
+ const blakeHash = blake2b(5, undefined, undefined, undefined, true)\r
+ .update(keyBytes).digest().reverse()\r
if (bytes.toHex(checksumBytes) !== bytes.toHex(blakeHash)) {\r
throw new Error('Checksum mismatch in address')\r
}\r
\r
static async #keyToAddress (key: string): Promise<string> {\r
const publicKeyBytes = hex.toBytes(key)\r
- const checksum = blake2b(5, undefined, undefined, undefined, true).update(publicKeyBytes).digest().reverse()\r
+ const checksum = blake2b(5, undefined, undefined, undefined, true)\r
+ .update(publicKeyBytes).digest().reverse()\r
const encoded = bytes.toBase32(publicKeyBytes)\r
const encodedChecksum = bytes.toBase32(checksum)\r
return `${PREFIX}${encoded}${encodedChecksum}`\r