#include <hash.h>
UniqueHasher allows to compute a 128-bit UniqueHash from a sequence of values. The values are passed to the hasher using a series of calls to Combine() functions. At the end, the Finalize() function returns the final hash value.
Computing the hash value through a series of calls is slower than a one-shot computation of a single byte block using UniqueHash::GetUniqueHashCode(). For better performance, you should prefer the one-shot computation if possible.
Public Types | |
using | ValueType = UniqueHash |
Public Member Functions | |
UniqueHasher () | |
void | Combine (const Block< const Byte > &bytes) |
void | Combine (const Byte *ptr, Int count) |
void | Combine (const UniqueHash &value) |
template<typename HASH = DefaultCompare, typename... ARGS> | |
void | HashAndCombine (const ARGS &... values) |
UniqueHash | Finalize () const |
operator UniqueHash () const | |
Static Public Member Functions | |
template<typename... H> | |
static UniqueHash | CombineHashes (const H &... hashes) |
Private Member Functions | |
template<typename HASH , typename T > | |
void | HashAndCombineImpl (const T &value) |
Private Attributes | |
UInt64 | _state [72] |
using ValueType = UniqueHash |
void HashAndCombine | ( | const ARGS &... | values | ) |
Mixes hashes of the given values into the hasher state. If a value's type is trivially hashable, its raw bytes are used for mixing. Otherwise the hash value returned by {HASH::GetUniqueHashCode(value)} is used.
[in] | values | Values whose hashes shall be combined into this hasher's state. |
|
static |
Computes a UniqueHash from a sequence of hash values.
[in] | hashes | A sequence of hash values. |
|
private |
|
private |