![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
FNV-1a hash algorithm. More...

Public Types | |
| using | argument_type = T |
| The type of the argument of the function call operator. | |
| using | result_type = size_t |
| The type of the result of the function call operator. | |
Public Member Functions | |
| auto | operator() (T const &value) const noexcept -> size_t |
| Calculate the hash of a value. | |
FNV-1a hash algorithm.
| T | the type to hash |
Implement the Fowler-Noll-Vo hashing algorithm with the 1a variant. This hashing algorithm uses two constants that depend on the bit-length of std::size_t for the current platform.
The algorithm starts with an initial hash value of FNV offset basis. For each byte in the input, XOR the hash with the byte from the input, then multiply it by the FNV prime:
| using std::hash_detail::fnv1a_hash< T >::argument_type = T |
The type of the argument of the function call operator.
| using std::hash_detail::fnv1a_hash< T >::result_type = size_t |
The type of the result of the function call operator.
|
inlinenoexcept |
Calculate the hash of a value.
| value | The value to hash |