DefaultHasher Class Reference

#include <hash.h>

Public Types

using ValueType = HashInt
 

Public Member Functions

MAXON_IMPLICIT DefaultHasher (HashInt start=EMPTY_HASH)
 
void Combine (HashInt value)
 
void CombineUnordered (HashInt value)
 
HashInt Finalize () const
 
 operator HashInt () const
 

Static Public Member Functions

static constexpr UInt32 Mix (UInt32 h)
 
static constexpr UInt64 Mix (UInt64 h)
 
static constexpr HashInt SplitMix (HashInt value)
 
template<typename... R>
static HashInt CombineHashes (HashInt first, R... rest)
 

Static Public Attributes

static constexpr HashInt EMPTY_HASH
 

Static Private Member Functions

static void CombineHashesImpl (DefaultHasher &hash)
 
template<typename... R>
static void CombineHashesImpl (DefaultHasher &hash, HashInt x, R... rest)
 

Private Attributes

HashInt _state
 

Member Typedef Documentation

◆ ValueType

using ValueType = HashInt

Constructor & Destructor Documentation

◆ DefaultHasher()

Member Function Documentation

◆ Mix() [1/2]

static constexpr UInt32 Mix ( UInt32  h)
staticconstexpr

◆ Mix() [2/2]

static constexpr UInt64 Mix ( UInt64  h)
staticconstexpr

◆ SplitMix()

static constexpr HashInt SplitMix ( HashInt  value)
staticconstexpr

◆ Combine()

void Combine ( HashInt  value)

Combines the given value with the current state in an ordered way, which means that the effect of multiple calls to Combine does depend on the order of those calls. You can use this function to compute a hash value of a sequence of HashInts when the sequence order is important.

Parameters
[in]valueA hash value.

◆ CombineUnordered()

void CombineUnordered ( HashInt  value)

Combines the given value with the current state 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 hash value of a sequence of HashInts when the sequence order shall be irrelevant.

Parameters
[in]valueA hash value.

◆ Finalize()

HashInt Finalize ( ) const

◆ operator HashInt()

operator HashInt ( ) const

◆ CombineHashes()

static HashInt CombineHashes ( HashInt  first,
R...  rest 
)
static

◆ CombineHashesImpl() [1/2]

static void CombineHashesImpl ( DefaultHasher hash)
staticprivate

◆ CombineHashesImpl() [2/2]

static void CombineHashesImpl ( DefaultHasher hash,
HashInt  x,
R...  rest 
)
staticprivate

Member Data Documentation

◆ EMPTY_HASH

constexpr HashInt EMPTY_HASH
staticconstexpr

◆ _state

HashInt _state
private