KiCad PCB EDA Suite
Loading...
Searching...
No Matches
MMH3_HASH Class Reference

A streaming C++ equivalent for MurmurHash3_x64_128. More...

#include <mmh3_hash.h>

Public Member Functions

 MMH3_HASH ()
 
 MMH3_HASH (uint32_t aSeed)
 
FORCE_INLINE void reset (uint32_t aSeed=0)
 
FORCE_INLINE void addData (const uint8_t *data, size_t length)
 
FORCE_INLINE void add (const std::string &input)
 
FORCE_INLINE void add (const std::vector< char > &input)
 
FORCE_INLINE void add (int32_t input)
 
FORCE_INLINE HASH_128 digest ()
 

Private Member Functions

FORCE_INLINE uint64_t getblock64 (int i)
 
FORCE_INLINE void hashBlock ()
 
FORCE_INLINE void hashTail ()
 
FORCE_INLINE void hashFinal (HASH_128 &out)
 

Static Private Member Functions

static FORCE_INLINE uint64_t fmix64 (uint64_t k)
 

Private Attributes

uint64_t h1
 
uint64_t h2
 
union {
   uint32_t   blocks [4]
 
   uint64_t   blocks64 [2]
 
}; 
 
uint32_t len
 

Detailed Description

A streaming C++ equivalent for MurmurHash3_x64_128.

Definition at line 59 of file mmh3_hash.h.

Constructor & Destructor Documentation

◆ MMH3_HASH() [1/2]

MMH3_HASH::MMH3_HASH ( )
inline

Definition at line 62 of file mmh3_hash.h.

References reset().

◆ MMH3_HASH() [2/2]

MMH3_HASH::MMH3_HASH ( uint32_t  aSeed)
inline

Definition at line 64 of file mmh3_hash.h.

References reset().

Member Function Documentation

◆ add() [1/3]

◆ add() [2/3]

FORCE_INLINE void MMH3_HASH::add ( const std::vector< char > &  input)
inline

Definition at line 100 of file mmh3_hash.h.

References addData().

◆ add() [3/3]

FORCE_INLINE void MMH3_HASH::add ( int32_t  input)
inline

Definition at line 105 of file mmh3_hash.h.

References blocks, hashBlock(), and len.

◆ addData()

FORCE_INLINE void MMH3_HASH::addData ( const uint8_t *  data,
size_t  length 
)
inline

Definition at line 73 of file mmh3_hash.h.

References blocks, hashBlock(), and len.

Referenced by add().

◆ digest()

◆ fmix64()

static FORCE_INLINE uint64_t MMH3_HASH::fmix64 ( uint64_t  k)
inlinestaticprivate

Definition at line 185 of file mmh3_hash.h.

References BIG_CONSTANT.

Referenced by hashFinal().

◆ getblock64()

FORCE_INLINE uint64_t MMH3_HASH::getblock64 ( int  i)
inlineprivate

Definition at line 128 of file mmh3_hash.h.

References blocks64.

Referenced by hashBlock().

◆ hashBlock()

FORCE_INLINE void MMH3_HASH::hashBlock ( )
inlineprivate

Definition at line 133 of file mmh3_hash.h.

References BIG_CONSTANT, getblock64(), h1, h2, and ROTL64.

Referenced by add(), and addData().

◆ hashFinal()

FORCE_INLINE void MMH3_HASH::hashFinal ( HASH_128 out)
inlineprivate

Definition at line 196 of file mmh3_hash.h.

References fmix64(), h1, h2, len, and HASH_128::Value64.

Referenced by digest().

◆ hashTail()

FORCE_INLINE void MMH3_HASH::hashTail ( )
inlineprivate

Definition at line 150 of file mmh3_hash.h.

References BIG_CONSTANT, blocks, h1, h2, len, and ROTL64.

Referenced by digest().

◆ reset()

FORCE_INLINE void MMH3_HASH::reset ( uint32_t  aSeed = 0)
inline

Definition at line 66 of file mmh3_hash.h.

References h1, h2, and len.

Referenced by BOOST_AUTO_TEST_CASE(), and MMH3_HASH().

Member Data Documentation

◆ 

union { ... } MMH3_HASH::@41

◆ blocks

uint32_t MMH3_HASH::blocks[4]

Definition at line 219 of file mmh3_hash.h.

Referenced by add(), addData(), and hashTail().

◆ blocks64

uint64_t MMH3_HASH::blocks64[2]

Definition at line 220 of file mmh3_hash.h.

Referenced by getblock64().

◆ h1

uint64_t MMH3_HASH::h1
private

Definition at line 215 of file mmh3_hash.h.

Referenced by hashBlock(), hashFinal(), hashTail(), and reset().

◆ h2

uint64_t MMH3_HASH::h2
private

Definition at line 216 of file mmh3_hash.h.

Referenced by hashBlock(), hashFinal(), hashTail(), and reset().

◆ len

uint32_t MMH3_HASH::len
private

Definition at line 222 of file mmh3_hash.h.

Referenced by add(), addData(), hashFinal(), hashTail(), and reset().


The documentation for this class was generated from the following file: