datasketches-cpp
|
XXHash (64 bit), based on Yann Collet's descriptions, see http://cyan4973.github.io/xxHash/. More...
#include <xxhash64.h>
Public Member Functions | |
XXHash64 (uint64_t seed) | |
create new XXHash (64 bit) More... | |
bool | add (const void *input, uint64_t length) |
add a chunk of bytes More... | |
uint64_t | hash () const |
get current hash More... | |
Static Public Member Functions | |
static uint64_t | hash (const void *input, uint64_t length, uint64_t seed) |
combine constructor, add() and hash() in one static function (C style) More... | |
XXHash (64 bit), based on Yann Collet's descriptions, see http://cyan4973.github.io/xxHash/.
How to use: uint64_t myseed = 0; XXHash64 myhash(myseed); myhash.add(pointerToSomeBytes, numberOfBytes); myhash.add(pointerToSomeMoreBytes, numberOfMoreBytes); // call add() as often as you like to ... and compute hash: uint64_t result = myhash.hash();
or all of the above in one single line: uint64_t result2 = XXHash64::hash(mypointer, numBytes, myseed);
Note: my code is NOT endian-aware !
|
inlineexplicit |
create new XXHash (64 bit)
seed | your seed value, even zero is a valid seed |
|
inline |
add a chunk of bytes
input | pointer to a continuous block of data |
length | number of bytes |
|
inline |
get current hash
|
inlinestatic |