UNPKG

@helia/bitswap

Version:

JavaScript implementation of the Bitswap data exchange protocol used by Helia

9 lines (7 loc) 235 B
import ve from './varint-encoder.js' import type { CID } from 'multiformats/cid' export function cidToPrefix (cid: CID): Uint8Array { return ve([ cid.version, cid.code, cid.multihash.code, cid.multihash.digest.byteLength ]) }