#include <bslh_spookyhashalgorithmimp.h>
This class wraps an implementation of Bob Jenkin's "SpookyHash" in a BDE-style component. For more information, see http://burtleburtle.net/bob/hash/spooky.html .
See bslh_spookyhashalgorithmimp
◆ Uint16
◆ Uint32
◆ Uint64
◆ Uint8
◆ SpookyHashAlgorithmImp()
bslh::SpookyHashAlgorithmImp::SpookyHashAlgorithmImp |
( |
Uint64 |
seed1, |
|
|
Uint64 |
seed2 |
|
) |
| |
|
inline |
Create a bslh::SpookyHashAlgorithmImp
, initializing the internal state of the object using the specified seed1
and seed2
as seeds for the algorithm.
◆ ~SpookyHashAlgorithmImp()
bslh::SpookyHashAlgorithmImp::~SpookyHashAlgorithmImp |
( |
| ) |
|
|
default |
◆ finalize()
void bslh::SpookyHashAlgorithmImp::finalize |
( |
Uint64 * |
hash1, |
|
|
Uint64 * |
hash2 |
|
) |
| |
Load the finalized hash into the specified hash1
and hash2
. hash1
will contain the higher order bits of the hash and hash2
will contain the lower order bits. The internal state of the algorithm will be modified, meaning that calling final multiple times will result in different hash values being returned. The returned hash will be the same as if Hash128
had been called will all of the accumulated data in one block. The behavior is undefined unless both hash1
and hash2
point to 8 bytes of modifiable memory. Note that a value will be returned even if update
has not been called.
◆ hash128()
static void bslh::SpookyHashAlgorithmImp::hash128 |
( |
const void * |
message, |
|
|
size_t |
length, |
|
|
Uint64 * |
hash1, |
|
|
Uint64 * |
hash2 |
|
) |
| |
|
static |
Hash the specified length
bytes of message
using hash1
and hash2
as seeds. Load the higher order bits of the resulting 128-bit hash value into hash1
and the lower order bits in hash2
. The behavior is undefined unless message
points at least length
bytes of initialized memory or length
is zero, and both hash1
and hash2
point to at least 8 bytes of initialized, modifiable, memory.
◆ hash32()
Hash the specified length
bytes of message
using seed
as a seed. Return the resulting 32-bit hash. The behavior is undefined unless message
points at least length
bytes of initialized memory or length
is zero.
◆ hash64()
Hash the specified length
bytes of message
using seed
as a seed. Return the resulting 64-bit hash. The behavior is undefined unless message
points at least length
bytes of initialized memory or length
is zero.
◆ update()
void bslh::SpookyHashAlgorithmImp::update |
( |
const void * |
message, |
|
|
size_t |
length |
|
) |
| |
Accumulate the specified length
bytes of message
into the internal state of the algorithm. Accumulating bytes through Update
will produce the same result as hashing them all at once through the HashXX
static methods. The behavior is undefined unless message
points at least length
bytes of initialized memory or length
is zero.
The documentation for this class was generated from the following file: