Honeycomb  0.1
Component-Model Framework
Classes | Functions
honey::hash Namespace Reference

Data hashing functions. Produce a small fingerprint from a larger data set. Two data sets may 'collide', producing the same fingerprint. More...

Classes

struct  sval
 256-bit secure hash value More...
 

Functions

szt fast (ByteBufConst bs, szt seed=0)
 Quickly generate a small hash value. Each seed value produces a unique hash from the same data. More...
 
sval secure (ByteBufConst bs, optional< const sval & > key=optnull)
 Generate a large secure hash value. More...
 
vector< svalsecureKeys (const String &password, const Bytes &salt, int iterCount, int keyCount)
 Generate secure keys derived from a password. More...
 
szt fast (const char *str, szt seed=0)
 fast() for UTF-8 strings More...
 
szt fast (const std::string &str, szt seed=0)
 fast() for UTF-8 strings More...
 
szt fast (const String &str, szt seed=0)
 fast() for strings, converted to UTF-8 before hashing More...
 
constexpr szt fast_ (const char *str, szt len, szt seed=0)
 Compile-time version of fast() for UTF-8 strings. More...
 
sval secure (const char *str, optional< const sval & > key=optnull)
 secure() for UTF-8 strings More...
 
sval secure (const std::string &str, optional< const sval & > key=optnull)
 secure() for UTF-8 strings More...
 
sval secure (const String &str, optional< const sval & > key=optnull)
 secure() for strings, converted to UTF-8 before hashing More...
 

Detailed Description

Data hashing functions. Produce a small fingerprint from a larger data set. Two data sets may 'collide', producing the same fingerprint.

Function Documentation

szt honey::hash::fast ( const char *  str,
szt  seed = 0 
)
inline

fast() for UTF-8 strings

szt honey::hash::fast ( const std::string &  str,
szt  seed = 0 
)
inline

fast() for UTF-8 strings

szt honey::hash::fast ( const String str,
szt  seed = 0 
)
inline

fast() for strings, converted to UTF-8 before hashing

szt honey::hash::fast ( ByteBufConst  bs,
szt  seed 
)

Quickly generate a small hash value. Each seed value produces a unique hash from the same data.

constexpr szt honey::hash::fast_ ( const char *  str,
szt  len,
szt  seed = 0 
)
inline

Compile-time version of fast() for UTF-8 strings.

sval honey::hash::secure ( ByteBufConst  bs,
optional< const sval & >  key = optnull 
)

Generate a large secure hash value.

Parameters
bs
keyGenerate a keyed HMAC that can be used to verify message authenticity. Each key produces a unique hash from the same data.
sval honey::hash::secure ( const char *  str,
optional< const sval & >  key = optnull 
)
inline

secure() for UTF-8 strings

sval honey::hash::secure ( const std::string &  str,
optional< const sval & >  key = optnull 
)
inline

secure() for UTF-8 strings

sval honey::hash::secure ( const String str,
optional< const sval & >  key = optnull 
)
inline

secure() for strings, converted to UTF-8 before hashing

vector< sval > honey::hash::secureKeys ( const String password,
const Bytes salt,
int  iterCount,
int  keyCount 
)

Generate secure keys derived from a password.

Parameters
password
saltrandomly generated value to combat precomputed hash table attacks
iterCountnumber of PBKDF2 hash iterations, makes process computationally expensive to attack
keyCountnumber of returned keys