Contains two variants of the Fowler–Noll–Vo hashing function.
FNV is a non-cryptographic hash function that produces fewer hash collisions
than the crc32 hashing function that is available via vrt_hash
.
It is not appropriate for cryptographic purposes.
See also
Code Map
//! Contains two variants of the Fowler–Noll–Vo hashing function.
module watt.digest.fnv;
//! Hash data using a 32 bit variant of the FNV hash function.
fn hashFNV1A_32(arr: scope (const(scope (void)[])) u32 { }
//! Hash data using a 64 bit variant of the FNV hash function.
fn hashFNV1A_64(arr: scope (const(scope (void)[])) u64 { }
Hash data using a 32 bit variant of the FNV hash function.
You'll have to cast
most data to void[]
in order for this function
to accept it. Internally, it treats the data as a series of bytes.
Parameters
arr |
The data to hash. |
Return
A 32 bit unsigned integer with the calculated hash value.
Hash data using a 64 bit variant of the FNV hash function.
You'll have to cast
most data to void[]
in order for this function
to accept it. Internally, it treats the data as a series of bytes.
Parameters
arr |
The data to hash. |
Return
A 64 bit unsigned integer with the calculated hash value.