Skip to main content

content_hash

Function content_hash 

Source
pub fn content_hash(s: &str) -> u64
Expand description

Compute a fast, non-cryptographic hash of a string for cache keying.

The underlying algorithm is zeph_common::hash::fast_hash (xxHash or similar). The result is stable within a process but should not be persisted.

§Examples

use zeph_tui::render_cache::content_hash;

let h = content_hash("hello");
assert_eq!(h, content_hash("hello")); // deterministic
assert_ne!(h, content_hash("world")); // distinct inputs → distinct hashes