Skip to main content

hash_with_context

Function hash_with_context 

Source
pub fn hash_with_context(context: &str, data: &[u8]) -> Hash
Expand description

Compute the BLAKE3 hash with a domain-separated context string.

Context strings prevent cross-domain hash collisions. For example, a patch hash and a blob hash should never collide even if they contain identical data. We use keyed hashing with a context-derived key.