std::hash
Hash Module
Deterministic hashing foundations for collections and user-defined keys.
The default hasher uses 64-bit FNV-1a with a fixed offset basis and no randomized seeding. Hashes are therefore deterministic for a given stdlib and compiler version.
writeStr hashes NUL-terminated str data.
Owned String values should hash all owned bytes without routing through raw toStr().
namespace __hash_rtFunctions
function ignis_hash_fnv1a_cstr(state: u64, value: str): u64Continues an FNV-1a hash over a NUL-terminated C string.
Records
record HasherDeterministic 64-bit FNV-1a hasher used by std collections.
The hasher has a fixed seed and byte order, so output is stable across runs for the same std implementation. It is intended for hash tables and tests, not for cryptographic or adversarial-input protection.
state: u64Current FNV-1a state.
static new(): HasherCreates a hasher initialized to the FNV offset basis.
finish(&self): u64Returns the current 64-bit hash state without resetting the hasher.
reset(&mut self): voidResets this hasher to its initial offset-basis state.
writeBoolean(&mut self, value: boolean): voidMixes a boolean as a single canonical byte (0 or 1).
writeByte(&mut self, value: u8): voidMixes one byte into the current FNV-1a state.
writeChar(&mut self, value: char): voidMixes a byte-backed Ignis char value.
writeI16(&mut self, value: i16): voidMixes an i16 by its two’s-complement little-endian representation.
writeI32(&mut self, value: i32): voidMixes an i32 by its two’s-complement little-endian representation.
writeI64(&mut self, value: i64): voidMixes an i64 by its two’s-complement little-endian representation.
writeI8(&mut self, value: i8): voidMixes an i8 by its two’s-complement byte representation.
writeStr(&mut self, value: str): voidMixes a NUL-terminated string view.
Hashing stops at the first NUL byte because str is represented as a C
string view. Owned String hashing should not use this for interior-NUL
preserving behavior.
writeU16(&mut self, value: u16): voidMixes a u16 in little-endian byte order.
writeU32(&mut self, value: u32): voidMixes a u32 in little-endian byte order.
writeU64(&mut self, value: u64): voidMixes a u64 in little-endian byte order.
Traits
trait EqCanonical equality marker trait.
Types marked with @implements(Eq) must provide
equals(&self, other: &ConcreteType): boolean.
trait HashTrait for values that can feed their canonical bytes into a Hasher.
Implementations must be consistent with Eq: if two values compare equal,
they must write the same byte sequence to the hasher.
hash(&self): voidFunctions
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function equals(value: str, other: str): booleanImplements byte-wise equality for NUL-terminated string views.
Comparison stops at the first NUL byte in either view. Use owned String
equality when interior NUL bytes must participate in comparison.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
function hash(value: str, hasher: &mut Hasher): voidImplements Hash for NUL-terminated string views.
Constants
const FNV_OFFSET_BASIS: u64const FNV_PRIME: u64