Expand description
BLAKE3 multicodec CID encoding for content-addressed interoperability. BLAKE3 multicodec CID encoding for content-addressed interoperability.
Encodes/decodes BLAKE3 digests as IPLD-compatible CID v1 identifiers.
Zero external dependencies beyond hex (already in fxcp-core).
§CID v1 wire format
raw binary: [0x01, 0x55, 0x1e, 0x20, <32 bytes>] = 36 bytes
blake3-hashseq: [0x01, 0x80, 0x01, 0x1e, 0x20, <32 bytes>] = 37 bytesMultibase string prefixes: b = base32lower (no padding), f = base16lower.
Enums§
- CidError
- Errors from CID encoding/decoding operations.
Constants§
- CID_
HASHSEQ_ BLAK E3_ LEN - Total byte length of a hashseq BLAKE3 CID v1.
- CID_
RAW_ BLAK E3_ LEN - Total byte length of a raw BLAKE3 CID v1 (prefix + 32-byte digest).
- CID_
V1_ HASHSEQ_ BLAK E3_ PREFIX - CID v1 prefix for blake3-hashseq (iroh-compatible collections).
0x80requires 2-byte unsigned varint:[0x80, 0x01]. - CID_
V1_ RAW_ BLAK E3_ PREFIX - CID v1 prefix for raw binary content + BLAKE3-256 multihash.
- MULTICODEC_
BLAK E3 - Multicodec code for BLAKE3 multihash function.
- MULTICODEC_
BLAK E3_ HASHSEQ - Multicodec code for blake3-hashseq (iroh collections).
- MULTICODEC_
RAW - Multicodec code for raw binary content type.
Functions§
- blake3_
hex_ to_ cid_ string - Convert a BLAKE3 hex digest (64 chars) to a base32lower CID string.
- blake3_
to_ cid_ bytes - Encode a BLAKE3 digest as raw CID v1 bytes (36 bytes).
- blake3_
to_ cid_ hex - Encode a BLAKE3 digest as a hex CID string (
fmultibase prefix). - blake3_
to_ cid_ string - Encode a BLAKE3 digest as a base32lower CID string (
bmultibase prefix). - blake3_
to_ hashseq_ cid_ bytes - Encode a BLAKE3 digest as hashseq CID v1 bytes (37 bytes).
- blake3_
to_ hashseq_ cid_ string - Encode a BLAKE3 digest as a base32lower hashseq CID string.
- cid_
bytes_ to_ blake3 - Extract BLAKE3 digest from CID bytes. Returns
Noneif prefix/length mismatch. - cid_
string_ to_ blake3 - Decode a multibase CID string to its BLAKE3 digest.
- cid_
string_ to_ hex - Decode a CID string to its BLAKE3 hex digest.
- is_
blake3_ cid_ bytes - Check if raw bytes are a valid BLAKE3 CID (raw or hashseq prefix).
- is_
blake3_ cid_ string - Check if a string is a valid base32lower or hex-encoded BLAKE3 CID.
- is_
blake3_ hex - Check if a string looks like a 64-character hex BLAKE3 digest.
- normalize_
blake3_ to_ cid - Normalize a BLAKE3 hash string to CID base32lower format.