header_utils
|
Hashing functions. More...
Functions | |
template<bytelike_range RANGE> | |
constexpr uint32_t | ghassanpl::crc32 (RANGE &&bytes) |
Calculates a CRC32 for a range of bytelikes. | |
template<bytelike... BYTES> | |
constexpr uint32_t | ghassanpl::crc32 (BYTES... bytes) |
Calculates a CRC32 for a variadic number of bytelikes. | |
constexpr auto | ghassanpl::crc32 (const source_location &k) |
Calculates a CRC32 of a source_location (constexpr, so can be used at compile time) | |
template<bytelike_range RANGE> | |
constexpr uint64_t | ghassanpl::crc64 (RANGE &&bytes) |
Calculates a CRC4 for a range of bytelikes. | |
template<bytelike... BYTES> | |
constexpr uint64_t | ghassanpl::crc64 (BYTES... bytes) |
Calculates a CRC4 for a variadic number of bytelikes. | |
constexpr auto | ghassanpl::crc64 (const source_location &k) |
Calculates a CRC64 of a source_location (constexpr, so can be used at compile time) | |
template<bytelike_range RANGE> | |
constexpr uint64_t | ghassanpl::fnv64 (RANGE &&bytes) |
TODO: Add support for non-64bit hashes to all the functions below, especially since std::hash operates on size_t. | |
template<bytelike... BYTES> | |
constexpr uint64_t | ghassanpl::fnv64 (BYTES... bytes) |
Calculates a FNV Hash for a variadic number of bytes. | |
template<typename T , typename HASHER = std::hash<std::remove_cvref_t<T>>> | |
constexpr void | ghassanpl::hash64_combine_to (uint64_t &seed, T &&v, HASHER &&hasher=HASHER{}) |
TODO: ce_hash64(array/span) TODO: ce_hash64(thread::id) ? TODO: ce_hash64(optional/variant) ? | |
template<typename It , typename HASHER = std::hash<std::iter_value_t<It>>> | |
constexpr void | ghassanpl::hash64_range (uint64_t &seed, It first, It last, HASHER const &hasher={}) |
Combines an existing hash value (seed ) with the hash of a range of values. | |
template<typename It , typename HASHER = std::hash<std::iter_value_t<It>>> | |
constexpr uint64_t | ghassanpl::hash64_range (It first, It last, HASHER &&hasher={}) |
Hashes a range of values. | |
template<std::ranges::range T, typename HASHER = std::hash<std::ranges::range_value_t<T>>> | |
constexpr uint64_t | ghassanpl::hash64_range (T range, HASHER &&hasher={}) |
Hashes a range of values. | |
Hashing functions.