diff --git a/src/cid.ts b/src/cid.ts index b690006..1723e93 100644 --- a/src/cid.ts +++ b/src/cid.ts @@ -36,7 +36,7 @@ export function encodeCid(hash: any, size: bigint) { export function decodeCid(cid: string): CID { let bytes = base58btc.decode(cid); - if (!arrayBufferEqual(bytes.slice(0, 2).buffer, bytes.buffer)) { + if (!arrayBufferEqual(bytes.slice(0, 2).buffer, MAGIC_BYTES.buffer)) { throw new Error("Invalid cid"); }