Skip to main content

signature_hash

Function signature_hash 

Source
pub fn signature_hash(parts: &[&str]) -> String
Expand description

Produce a stable, low-cost signature hash for an arbitrary list of string fields.

Returns a "fnv64:<hex>" string suitable for use as a FreshnessContract::signature_hash. The function is pure and deterministic — equal inputs always produce the same output.

§Example

use stygian_browser::freshness::signature_hash;

let h = signature_hash(&["example.com", "MacIntel", "1920x1080"]);
assert!(h.starts_with("fnv64:"));
assert_eq!(h, signature_hash(&["example.com", "MacIntel", "1920x1080"]));