Skip to main content

value_hash

Function value_hash 

Source
pub fn value_hash(val: &Value) -> u64
Expand description

Compute a deterministic hash for a CJC Value.

Dispatches on the value variant, serializing to bytes and hashing via murmurhash3. Enum variants recursively hash their fields. Unsupported variants (e.g., closures, tensors) map to a fixed sentinel byte.

ยงDeterminism

The same Value always produces the same hash, regardless of platform or run. Float hashing uses to_bits() so that NaN and -0.0 hash consistently.