Skip to main content

q_hash

Function q_hash 

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

A zero-allocation compile-time hashing function for Q-Turtle macros. Uses FNV-1a, then truncates to 60 bits so the result is a pure IDENTIFIER: the top 4 bits [60..63] are reserved as the role-keyed type/modality/tag overlay (inline datatype tags in the Object register, the deontic DEFEATER_BIT in the Predicate, etc.). This is the ONE canonical term-identity hash — it MUST stay bit-for-bit identical to lexicon::generate_60bit_token (same FNV constants + the same 0x0FFF_FFFF_FFFF_FFFF mask) so compile-time-baked URIs and runtime-parsed/ingested URIs share a single hash space and JOIN.