![]() |
Plasma Engine
2.0
|
This class provides implementations of different hashing algorithms. More...
#include <HashingUtils.h>
Static Public Member Functions | |
static plUInt32 | CRC32Hash (const void *pKey, size_t uiSizeInBytes) |
Calculates the CRC32 checksum of the given key. | |
static plUInt32 | MurmurHash32 (const void *pKey, size_t uiSizeInByte, plUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of the given key. | |
static plUInt64 | MurmurHash64 (const void *pKey, size_t uiSizeInByte, plUInt64 uiSeed=0) |
Calculates the 64bit murmur hash of the given key. | |
template<size_t N> | |
static constexpr plUInt32 | MurmurHash32String (const char(&str)[N], plUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of a string constant at compile time. Encoding does not matter here. | |
static plUInt32 | MurmurHash32String (plStringView sStr, plUInt32 uiSeed=0) |
Calculates the 32bit murmur hash of a string pointer during runtime. Encoding does not matter here. | |
static plUInt32 | xxHash32 (const void *pKey, size_t uiSizeInByte, plUInt32 uiSeed=0) |
Calculates the 32bit xxHash of the given key. | |
static plUInt64 | xxHash64 (const void *pKey, size_t uiSizeInByte, plUInt64 uiSeed=0) |
Calculates the 64bit xxHash of the given key. | |
template<size_t N> | |
static constexpr plUInt32 | xxHash32String (const char(&str)[N], plUInt32 uiSeed=0) |
Calculates the 32bit xxHash of the given string literal at compile time. | |
template<size_t N> | |
static constexpr plUInt64 | xxHash64String (const char(&str)[N], plUInt64 uiSeed=0) |
Calculates the 64bit xxHash of the given string literal at compile time. | |
static plUInt32 | xxHash32String (plStringView sStr, plUInt32 uiSeed=0) |
Calculates the 32bit xxHash of a string pointer during runtime. | |
static plUInt64 | xxHash64String (plStringView sStr, plUInt64 uiSeed=0) |
Calculates the 64bit xxHash of a string pointer during runtime. | |
template<size_t N> | |
static constexpr plUInt64 | StringHash (const char(&str)[N], plUInt64 uiSeed=0) |
Calculates the hash of the given string literal at compile time. | |
static plUInt64 | StringHash (plStringView sStr, plUInt64 uiSeed=0) |
Calculates the hash of a string pointer at runtime. | |
static constexpr plUInt32 | StringHashTo32 (plUInt64 uiHash) |
Truncates a 64 bit string hash to 32 bit. | |
static constexpr plUInt32 | CombineHashValues32 (plUInt32 ui0, plUInt32 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.