Skip to main content

hash_str

Function hash_str 

Source
pub fn hash_str(text: &str) -> u64
Expand description

FNV-1a, 64-bit, over text’s bytes — the function hash uses, exposed so a test can hash a deliberately perturbed copy of the document and assert the hash moved with it.

Not cryptographic and not asked to be: the question it answers is “is the studio’s copy of this document the one this player is running”, where the adversary is a stale file rather than a person. Written out rather than taken from DefaultHasher, whose output std explicitly does not promise to be stable across releases — a hash a studio caches has to survive a toolchain bump.