#include <MurmurHash3.h>
Public Types | |
enum | { kDefaultSeed = 0xe086c5ff } |
typedef UInt_t | Hash_t |
typedef Int_t | Length_t |
typedef Byte_t | Rot_t |
Public Member Functions | |
MurmurHash3 (unsigned int seed=kDefaultSeed) | |
void | Reset (UInt_t seed=kDefaultSeed) |
void | Add (MsgPtr_t msg_ptr, Length_t len) |
template<typename T > | |
MurmurHash3 & | Add (T *ptr, Length_t len) |
template<typename T > | |
MurmurHash3 & | Add (const T &thing, Length_t len) |
Hash_t | Value () const |
Hash_t | End (UInt_t seed=kDefaultSeed) |
Private Member Functions | |
Hash_t & | EndImp (Hash_t &hash, UInt_t &tail) const |
Takes parameters by reference and will mush them. | |
void | MixTail (MsgPtr_t &data, Length_t &len) |
UInt_t | rot32 (UInt_t bits, Rot_t r) const |
void | mmix (Hash_t &h, UInt_t &bits) const |
void | final_mix (Hash_t &h) const |
Private Attributes | |
Hash_t | fHash |
UInt_t | fTail |
UInt_t | fCount |
UInt_t | fSize |
Static Private Attributes | |
static const UInt_t | kMply1 = 0xcc9e2d51 |
static const UInt_t | kMply2 = 0x1b873593 |
Definition at line 25 of file MurmurHash3.h.
typedef UInt_t hash::MurmurHash3::Hash_t |
Definition at line 29 of file MurmurHash3.h.
typedef Int_t hash::MurmurHash3::Length_t |
Definition at line 30 of file MurmurHash3.h.
typedef Byte_t hash::MurmurHash3::Rot_t |
Definition at line 31 of file MurmurHash3.h.
anonymous enum |
Definition at line 27 of file MurmurHash3.h.
00027 {kDefaultSeed = 0xe086c5ff};
hash::MurmurHash3::MurmurHash3 | ( | unsigned int | seed = kDefaultSeed |
) | [inline] |
MurmurHash3& hash::MurmurHash3::Add | ( | const T & | thing, | |
Length_t | len | |||
) | [inline] |
Definition at line 54 of file MurmurHash3.h.
References Add().
00055 { 00056 Add(reinterpret_cast<MsgPtr_t>(&thing), len); 00057 return *this; 00058 }
MurmurHash3& hash::MurmurHash3::Add | ( | T * | ptr, | |
Length_t | len | |||
) | [inline] |
Definition at line 47 of file MurmurHash3.h.
References Add().
00048 { 00049 Add(reinterpret_cast<MsgPtr_t>(ptr), len); 00050 return *this; 00051 }
MurmurHash3::Hash_t MurmurHash3::End | ( | UInt_t | seed = kDefaultSeed |
) |
Before returning, add any remaining tail, the message length and mush up the bits a bit more. We never want to apply the end mushing repeatedly - that would be ambiguous - so this also Resets the object.
Definition at line 40 of file MurmurHash3.cpp.
MurmurHash3::Hash_t & MurmurHash3::EndImp | ( | Hash_t & | hash, | |
UInt_t & | tail | |||
) | const [inline, private] |
Takes parameters by reference and will mush them.
Definition at line 50 of file MurmurHash3.cpp.
References final_mix(), fSize, and mmix().
void hash::MurmurHash3::final_mix | ( | Hash_t & | h | ) | const [inline, private] |
Definition at line 81 of file MurmurHash3.h.
Referenced by EndImp().
void hash::MurmurHash3::mmix | ( | Hash_t & | h, | |
UInt_t & | bits | |||
) | const [inline, private] |
void hash::MurmurHash3::Reset | ( | UInt_t | seed = kDefaultSeed |
) | [inline] |
UInt_t hash::MurmurHash3::rot32 | ( | UInt_t | bits, | |
Rot_t | r | |||
) | const [inline, private] |
Definition at line 70 of file MurmurHash3.h.
Referenced by mmix().
MurmurHash3::Hash_t MurmurHash3::Value | ( | ) | const |
UInt_t hash::MurmurHash3::fCount [private] |
Definition at line 101 of file MurmurHash3.h.
Hash_t hash::MurmurHash3::fHash [private] |
UInt_t hash::MurmurHash3::fSize [private] |
Definition at line 102 of file MurmurHash3.h.
UInt_t hash::MurmurHash3::fTail [private] |
const UInt_t hash::MurmurHash3::kMply1 = 0xcc9e2d51 [static, private] |
Definition at line 90 of file MurmurHash3.h.
Referenced by mmix().
const UInt_t hash::MurmurHash3::kMply2 = 0x1b873593 [static, private] |
Definition at line 91 of file MurmurHash3.h.
Referenced by mmix().