pub enum Hasher {
Blake3(Box<Hasher>),
Sha256(Sha256),
}Expand description
Streaming hash-function dispatcher.
Construct with Hasher::new, feed canonical bytes via
Hasher::update, finalise with Hasher::finalize. The
finalised digest is a fixed-width 32-byte array: both
specification-recognised functions (CACHE-002) emit 32 bytes
(BLAKE3’s 256-bit output, SHA-256’s natural width). The cache
key is the finalised digest unchanged (CACHE-001,
CACHE-009).
Hasher is intentionally not Clone: cache-key derivation
consumes a single hasher across all components in order. Cloning
the in-progress state would invite subtle errors where two keys
share a prefix and diverge.
Hasher::Blake3’s state is large (about 2 KiB of internal
buffers); it is boxed to keep the enum’s stack footprint
modest, since SHA-256’s state is roughly 112 bytes.