![]() |
XII Release 0.1.0
|
This class provides implementations of different hashing algorithms. More...
#include <HashingUtils.h>
Static Public Member Functions | |
static xiiUInt32 | CRC32Hash (const void *pKey, size_t uiSizeInBytes) |
Calculates the CRC32 checksum of the given key. | |
static xiiUInt32 | MurmurHash32 (const void *pKey, size_t uiSizeInByte, xiiUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of the given key. | |
static xiiUInt64 | MurmurHash64 (const void *pKey, size_t uiSizeInByte, xiiUInt64 uiSeed=0) |
Calculates the 64bit murmur hash of the given key. | |
template<size_t N> | |
static constexpr xiiUInt32 | MurmurHash32String (const char(&str)[N], xiiUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of a string constant at compile time. Encoding does not matter here. | |
static xiiUInt32 | MurmurHash32String (xiiStringView sStr, xiiUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of a string pointer during runtime. Encoding does not matter here. | |
static xiiUInt32 | xxHash32 (const void *pKey, size_t uiSizeInByte, xiiUInt32 uiSeed=0) |
Calculates the 32bit xxHash of the given key. | |
static xiiUInt64 | xxHash64 (const void *pKey, size_t uiSizeInByte, xiiUInt64 uiSeed=0) |
Calculates the 64bit xxHash of the given key. | |
template<size_t N> | |
static constexpr xiiUInt32 | xxHash32String (const char(&str)[N], xiiUInt32 uiSeed=0) |
Calculates the 32bit xxHash of the given string literal at compile time. | |
template<size_t N> | |
static constexpr xiiUInt64 | xxHash64String (const char(&str)[N], xiiUInt64 uiSeed=0) |
Calculates the 64bit xxHash of the given string literal at compile time. | |
static xiiUInt32 | xxHash32String (xiiStringView sStr, xiiUInt32 uiSeed=0) |
Calculates the 32bit xxHash of a string pointer during runtime. | |
static xiiUInt64 | xxHash64String (xiiStringView sStr, xiiUInt64 uiSeed=0) |
Calculates the 64bit xxHash of a string pointer during runtime. | |
template<size_t N> | |
static constexpr xiiUInt64 | StringHash (const char(&str)[N], xiiUInt64 uiSeed=0) |
Calculates the hash of the given string literal at compile time. | |
static xiiUInt64 | StringHash (xiiStringView sStr, xiiUInt64 uiSeed=0) |
Calculates the hash of a string pointer at runtime. | |
static constexpr xiiUInt32 | StringHashTo32 (xiiUInt64 uiHash) |
Truncates a 64 bit string hash to 32 bit. | |
static constexpr xiiUInt32 | CombineHashValues32 (xiiUInt32 ui0, xiiUInt32 ui1) |
Combines two 32 bit hash values into one. | |
This class provides implementations of different hashing algorithms.
|
static |
Calculates the 32bit murmur hash of a string pointer during runtime. Encoding does not matter here.
We cannot pass a string pointer directly since a string constant would be treated as pointer as well.
|
static |
Calculates the hash of a string pointer at runtime.
We cannot pass a string pointer directly since a string constant would be treated as pointer as well.
|
staticconstexpr |
Truncates a 64 bit string hash to 32 bit.
This is necessary when a 64 bit string hash is used in a hash table (which only uses 32 bit indices).
|
static |
Calculates the 32bit xxHash of a string pointer during runtime.
We cannot pass a string pointer directly since a string constant would be treated as pointer as well.
|
static |
Calculates the 64bit xxHash of a string pointer during runtime.
We cannot pass a string pointer directly since a string constant would be treated as pointer as well.