Module hashing

Module hashing 

Source
Expand description

Hash utilities for cache keys and identifiers.

Uses BLAKE3. Prefer 32-byte hashes for exact keys and 64-bit hashes for compact ids.

Functionsยง

hash_cache_content
Hashes cache content to a 32-byte digest (tenant + context + embedding + payload).
hash_context
Hashes a (role, plan) pair into a compact 64-bit context hash.
hash_prompt
Hashes a prompt to a 32-byte BLAKE3 digest.
hash_tenant_id
Hashes a tenant identifier string to a compact 64-bit id.
hash_to_u64
Computes a 64-bit hash of the input data using BLAKE3, truncated from 256 bits.