EpcTools
An event based multi-threaded C++ development framework.
|
Calculates a 32-bit, 64-bit or 128-bit hash value using the SipHash algorithm. More...
#include <ehash.h>
Classes | |
class | Key |
Represents a key to be used when calculating a hash value. More... | |
Static Public Member Functions | |
static Key & | setKey (const Key &k) |
Assigns a new default key value. More... | |
static Key & | setKey (cpUChar val, const size_t len) |
Assigns a new default key value. More... | |
static const Key & | key () |
Retrieves the default key. More... | |
static ULong | getHash32 (EString &str, const Key &key=key_) |
Returns the 32-bit hash associated with the string. More... | |
static ULong | getHash32 (cpChar val, const size_t len, const Key &key=key_) |
Returns the 32-bit hash associated with the character buffer. More... | |
static ULong | getHash32 (cpUChar in, const size_t inlen, const Key &key=key_) |
Returns the 32-bit hash associated with the unsigned character buffer. More... | |
static Bool | getHash32 (cpUChar in, const size_t inlen, pUChar out, const size_t outlen, const Key &key=key_) |
Calculates the 32-bit hash associated with the unsigned character buffer. More... | |
static ULongLong | getHash64 (EString &str, const Key &key=key_) |
Returns the 64-bit hash associated with the string. More... | |
static ULongLong | getHash64 (cpChar val, const size_t len, const Key &key=key_) |
Returns the 64-bit hash associated with the character buffer. More... | |
static ULongLong | getHash64 (cpUChar in, const size_t inlen, const Key &key=key_) |
Returns the 64-bit hash associated with the unsigned character buffer. More... | |
static Bool | getHash64 (cpUChar in, size_t inlen, pUChar out, const size_t outlen, const Key &key=key_) |
Calculates the 64-bit hash associated with the unsigned character buffer. More... | |
static Bool | getHash128 (EString &str, pUChar out, const size_t outlen, const Key &key=key_) |
Calculates the 128-bit hash associated with the string. More... | |
static Bool | getHash128 (cpChar val, size_t len, pUChar out, const size_t outlen, const Key &key=key_) |
Calculates the 128-bit hash associated with the character buffer. More... | |
static Bool | getHash128 (cpUChar in, size_t inlen, pUChar out, const size_t outlen, const Key &key=key_) |
Calculates the 128-bit hash associated with the unsigned character buffer. More... | |
Calculates a 32-bit, 64-bit or 128-bit hash value using the SipHash algorithm.
|
inlinestatic |
Calculates the 128-bit hash associated with the character buffer.
val | The character buffer to calculate the hash for. |
len | The length of the unsigned character buffer. |
out | The output buffer for the resulting hash. |
outlen | The length of the output buffer. |
key | The key to be used to calculate the hash. |
|
static |
Calculates the 128-bit hash associated with the unsigned character buffer.
in | The unsigned character buffer to calculate the hash for. |
inlen | The length of the unsigned character buffer. |
out | The output buffer for the resulting hash. |
outlen | The length of the output buffer. |
key | The key to be used to calculate the hash. |
|
inlinestatic |
Calculates the 128-bit hash associated with the string.
str | The string to calculate the hash for. |
out | The output buffer for the resulting hash. |
outlen | The length of the output buffer. |
key | The key to be used to calculate the hash. |
|
inlinestatic |
Returns the 32-bit hash associated with the character buffer.
val | The character buffer to calculate the hash for. |
len | The length of the character buffer. |
key | The key to be used to calculate the hash. |
|
static |
Returns the 32-bit hash associated with the unsigned character buffer.
in | The unsigned character buffer to calculate the hash for. |
inlen | The length of the unsigned character buffer. |
key | The key to be used to calculate the hash. |
|
static |
Calculates the 32-bit hash associated with the unsigned character buffer.
in | The unsigned character buffer to calculate the hash for. |
inlen | The length of the unsigned character buffer. |
out | The output buffer for the resulting hash. |
outlen | The length of the output buffer. |
key | The key to be used to calculate the hash. |
Returns the 32-bit hash associated with the string.
str | The string to calculate the hash for. |
key | The key to be used to calculate the hash. |
|
inlinestatic |
Returns the 64-bit hash associated with the character buffer.
val | The character buffer to calculate the hash for. |
len | The length of the character buffer. |
key | The key to be used to calculate the hash. |
|
static |
Returns the 64-bit hash associated with the unsigned character buffer.
in | The unsigned character buffer to calculate the hash for. |
inlen | The length of the unsigned character buffer. |
key | The key to be used to calculate the hash. |
|
static |
Calculates the 64-bit hash associated with the unsigned character buffer.
in | The unsigned character buffer to calculate the hash for. |
inlen | The length of the unsigned character buffer. |
out | The output buffer for the resulting hash. |
outlen | The length of the output buffer. |
key | The key to be used to calculate the hash. |
Returns the 64-bit hash associated with the string.
str | The string to calculate the hash for. |
key | The key to be used to calculate the hash. |
|
inlinestatic |
Retrieves the default key.
Assigns a new default key value.
k | the new key value. |
|
inlinestatic |
Assigns a new default key value.
val | the key data for the new key value. |
len | the length of the key data. |