#include <hash.h>
UniqueHash is used as return type of GetUniqueHashCode functions. It has a size of 128 bits. For reasonable hash code functions it's a practically safe assumption that there are no hash collisions, so one can consider such a hash to be unique.
Public Member Functions | |
UniqueHash ()=default | |
constexpr | UniqueHash (UInt64 l, UInt64 h) |
Bool | operator== (const UniqueHash &other) const |
Bool | operator!= (const UniqueHash &other) const |
Bool | operator< (const UniqueHash &other) const |
MAXON_OPERATOR_INEQUALITY (UniqueHash) | |
HashInt | GetHashCode () const |
const UniqueHash & | GetUniqueHashCode () const |
constexpr UInt | operator& (UInt mask) const |
void | CombineUnordered (const UniqueHash &other) |
Static Public Member Functions | |
static constexpr Bool | TriviallyHashable () |
static UniqueHash | GetUniqueHashCode (const Byte *ptr, Int count) |
static UniqueHash | GetUniqueHashCode (const Block< const Byte > &bytes) |
template<typename... H> | |
static UniqueHash | CombineHashes (const H &... hashes) |
Public Attributes | |
UInt64 | low |
UInt64 | high |
|
default |
|
constexpr |
|
staticconstexpr |
Bool operator== | ( | const UniqueHash & | other | ) | const |
Bool operator!= | ( | const UniqueHash & | other | ) | const |
Bool operator< | ( | const UniqueHash & | other | ) | const |
MAXON_OPERATOR_INEQUALITY | ( | UniqueHash | ) |
HashInt GetHashCode | ( | ) | const |
const UniqueHash& GetUniqueHashCode | ( | ) | const |
Returns the bitwise and of the low bits of this UniqueHash and the given mask.
[in] | mask | A bit mask. |
void CombineUnordered | ( | const UniqueHash & | other | ) |
Combines the other UniqueHash with this UniqueHash in an unordered way, which means that the effect of multiple calls to CombineUnordered doesn't depend on the order of those calls. You can use this function to compute a UniqueHash of a sequence of UniqueHashes when the sequence order shall be irrelevant.
[in] | other | Another UniqueHash. |
|
static |
Computes a UniqueHash from a sequence of hash values.
[in] | hashes | A sequence of hash values. |
UInt64 low |
The lower 64 bits of the UniqueHash.
UInt64 high |
The higher 64 bits of the UniqueHash.