Skip to main content

Crate choir_hash

Crate choir_hash 

Source
Expand description

Self-describing content addressing (DECISIONS.md D6).

The codec byte names the hash function, so a future hash migration adds a codec instead of rewriting stored identifiers. Shared by L0 (store) and L1 (op log).

§Examples

use choir_hash::ContentHash;

let h = ContentHash::blake3(b"hello");
assert_eq!(h.codec, 0x1e); // BLAKE3-256 per the multicodec table
assert_eq!(h.digest.len(), 32);
assert_eq!(h, ContentHash::blake3(b"hello"));

§Where this sits

docs/architecture.md is the map of the whole workspace. This crate is the bottom of the stack: self-describing content addressing (D6), shared by L0 and L1.

It depends on no other crate in this workspace.

Structs§

ContentHash
Self-describing content address (multihash-style envelope).