From: Chris Duncan Date: Fri, 3 Jul 2026 08:21:02 +0000 (-0700) Subject: Skip reassignment. X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=94d5f4f5680b058c9428fa4e931a133953ef913f;p=libnemo.git Skip reassignment. --- diff --git a/src/lib/convert/bytes.ts b/src/lib/convert/bytes.ts index 033a818..7b693bc 100644 --- a/src/lib/convert/bytes.ts +++ b/src/lib/convert/bytes.ts @@ -28,8 +28,7 @@ export const bytes = Object.freeze({ if (bytes == null) return if (bytes instanceof ArrayBuffer && bytes.byteLength === 0) return if (bytes instanceof Uint8Array && bytes.buffer.byteLength === 0) return - bytes = bytes instanceof ArrayBuffer ? new Uint8Array(bytes) : bytes - bytes.fill(0) + bytes instanceof ArrayBuffer ? new Uint8Array(bytes).fill(0) : bytes.fill(0) }, /** @@ -50,10 +49,8 @@ export const bytes = Object.freeze({ */ toBase32 (bytes: ArrayBuffer | Bytes): string { if (bytes instanceof ArrayBuffer) bytes = new Uint8Array(bytes) - const leftover = (bytes.length * 8) % 5 - const offset = leftover === 0 - ? 0 - : 5 - leftover + const leftover = (bytes.length << 3) % 5 + const offset = (5 - leftover) % 5 let value = 0 let output = '' let bits = 0