EpcTools
An event based multi-threaded C++ development framework.
Classes | Static Public Member Functions | List of all members
ESipHash24 Class Reference

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 KeysetKey (const Key &k)
 Assigns a new default key value. More...
 
static KeysetKey (cpUChar val, const size_t len)
 Assigns a new default key value. More...
 
static const Keykey ()
 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 ULongLong getHash64 (cShort val, const Key &key=key_)
 Returns the 64-bit hash associated with the unsigned character buffer. More...
 
static ULongLong getHash64 (cUShort val, const Key &key=key_)
 
static ULongLong getHash64 (cLong val, const Key &key=key_)
 
static ULongLong getHash64 (cULong val, const Key &key=key_)
 
static ULongLong getHash64 (cLongLong val, const Key &key=key_)
 
static ULongLong getHash64 (cULongLong val, const Key &key=key_)
 
static ULongLong getHash64 (cFloat val, const Key &key=key_)
 
static ULongLong getHash64 (cDouble val, const Key &key=key_)
 
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...
 
static ULong getHash32 (cShort val, const Key &key=key_)
 Returns the 32-bit hash associated with the unsigned character buffer. More...
 
static ULong getHash32 (cUShort val, const Key &key=key_)
 
static ULong getHash32 (cLong val, const Key &key=key_)
 
static ULong getHash32 (cULong val, const Key &key=key_)
 
static ULong getHash32 (cLongLong val, const Key &key=key_)
 
static ULong getHash32 (cULongLong val, const Key &key=key_)
 
static ULong getHash32 (cFloat val, const Key &key=key_)
 
static ULong getHash32 (cDouble val, const Key &key=key_)
 
static Bool getHash128 (cShort val, pUChar out, const size_t outlen, const Key &key=key_)
 Calculates the 128-bit hash associated with the unsigned character buffer. More...
 
static Bool getHash128 (cUShort val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cLong val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cULong val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cLongLong val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cULongLong val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cFloat val, pUChar out, const size_t outlen, const Key &key=key_)
 
static Bool getHash128 (cDouble val, pUChar out, const size_t outlen, const Key &key=key_)
 

Detailed Description

Calculates a 32-bit, 64-bit or 128-bit hash value using the SipHash algorithm.

Member Function Documentation

static Bool ESipHash24::getHash128 ( EString str,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic

Calculates the 128-bit hash associated with the string.

Parameters
strThe string to calculate the hash for.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
static Bool ESipHash24::getHash128 ( cpChar  val,
size_t  len,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic

Calculates the 128-bit hash associated with the character buffer.

Parameters
valThe character buffer to calculate the hash for.
lenThe length of the unsigned character buffer.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
Bool ESipHash24::getHash128 ( cpUChar  in,
size_t  inlen,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
static

Calculates the 128-bit hash associated with the unsigned character buffer.

Parameters
inThe unsigned character buffer to calculate the hash for.
inlenThe length of the unsigned character buffer.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
static Bool ESipHash24::getHash128 ( cShort  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic

Calculates the 128-bit hash associated with the unsigned character buffer.

Parameters
valThe value to calculate the hash for.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
static Bool ESipHash24::getHash128 ( cUShort  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cLong  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cULong  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cLongLong  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cULongLong  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cFloat  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static Bool ESipHash24::getHash128 ( cDouble  val,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( EString str,
const Key key = key_ 
)
inlinestatic

Returns the 32-bit hash associated with the string.

Parameters
strThe string to calculate the hash for.
keyThe key to be used to calculate the hash.
Returns
The 32-bit hash value.
static ULong ESipHash24::getHash32 ( cpChar  val,
const size_t  len,
const Key key = key_ 
)
inlinestatic

Returns the 32-bit hash associated with the character buffer.

Parameters
valThe character buffer to calculate the hash for.
lenThe length of the character buffer.
keyThe key to be used to calculate the hash.
Returns
The 32-bit hash value.
ULong ESipHash24::getHash32 ( cpUChar  in,
const size_t  inlen,
const Key key = key_ 
)
static

Returns the 32-bit hash associated with the unsigned character buffer.

Parameters
inThe unsigned character buffer to calculate the hash for.
inlenThe length of the unsigned character buffer.
keyThe key to be used to calculate the hash.
Returns
The 32-bit hash value.
Bool ESipHash24::getHash32 ( cpUChar  in,
const size_t  inlen,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
static

Calculates the 32-bit hash associated with the unsigned character buffer.

Parameters
inThe unsigned character buffer to calculate the hash for.
inlenThe length of the unsigned character buffer.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
static ULong ESipHash24::getHash32 ( cShort  val,
const Key key = key_ 
)
inlinestatic

Returns the 32-bit hash associated with the unsigned character buffer.

Parameters
valThe value to calculate the hash for.
keyThe key to be used to calculate the hash.
Returns
The 32-bit hash value.
static ULong ESipHash24::getHash32 ( cUShort  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cLong  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cULong  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cLongLong  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cULongLong  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cFloat  val,
const Key key = key_ 
)
inlinestatic
static ULong ESipHash24::getHash32 ( cDouble  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( EString str,
const Key key = key_ 
)
inlinestatic

Returns the 64-bit hash associated with the string.

Parameters
strThe string to calculate the hash for.
keyThe key to be used to calculate the hash.
Returns
The 64-bit hash value.
static ULongLong ESipHash24::getHash64 ( cpChar  val,
const size_t  len,
const Key key = key_ 
)
inlinestatic

Returns the 64-bit hash associated with the character buffer.

Parameters
valThe character buffer to calculate the hash for.
lenThe length of the character buffer.
keyThe key to be used to calculate the hash.
Returns
The 64-bit hash value.
ULongLong ESipHash24::getHash64 ( cpUChar  in,
const size_t  inlen,
const Key key = key_ 
)
static

Returns the 64-bit hash associated with the unsigned character buffer.

Parameters
inThe unsigned character buffer to calculate the hash for.
inlenThe length of the unsigned character buffer.
keyThe key to be used to calculate the hash.
Returns
The 64-bit hash value.
Bool ESipHash24::getHash64 ( cpUChar  in,
size_t  inlen,
pUChar  out,
const size_t  outlen,
const Key key = key_ 
)
static

Calculates the 64-bit hash associated with the unsigned character buffer.

Parameters
inThe unsigned character buffer to calculate the hash for.
inlenThe length of the unsigned character buffer.
outThe output buffer for the resulting hash.
outlenThe length of the output buffer.
keyThe key to be used to calculate the hash.
Returns
True
static ULongLong ESipHash24::getHash64 ( cShort  val,
const Key key = key_ 
)
inlinestatic

Returns the 64-bit hash associated with the unsigned character buffer.

Parameters
valThe value to calculate the hash for.
keyThe key to be used to calculate the hash.
Returns
The 64-bit hash value.
static ULongLong ESipHash24::getHash64 ( cUShort  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cLong  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cULong  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cLongLong  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cULongLong  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cFloat  val,
const Key key = key_ 
)
inlinestatic
static ULongLong ESipHash24::getHash64 ( cDouble  val,
const Key key = key_ 
)
inlinestatic
static const Key& ESipHash24::key ( )
inlinestatic

Retrieves the default key.

Returns
Reference to the default key.
static Key& ESipHash24::setKey ( const Key k)
inlinestatic

Assigns a new default key value.

Parameters
kthe new key value.
Returns
A reference to the new key value.
static Key& ESipHash24::setKey ( cpUChar  val,
const size_t  len 
)
inlinestatic

Assigns a new default key value.

Parameters
valthe key data for the new key value.
lenthe length of the key data.
Returns
A reference to the new key value.

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