C3D Toolkit  Kernel - 117982, Vision - 2.9.2.2
hash32.h File Reference

Hash-function with probability of collisions 1/(2^32). More...

#include <io_define.h>
#include <tool_cstring.h>

Classes

class  c3d::StrHash
 Hash with a string type. More...
 

Namespaces

 c3d
 C3D namespace declaration.
 

Typedefs

typedef uint32 SimpleName
 Definition of simple name. More...
 

Functions

int SimpleNameCompare (const SimpleName &h1, const SimpleName &h2)
 Compare simple names.
 
bool IsGoodSimpleName (const SimpleName &s)
 Check the simple name correctness.
 
SimpleName c3d::Hash32 (uint8 *k, size_t length, SimpleName _c=INIT_HASH32_VAL)
 Hash-function. More...
 
template<typename T >
SimpleName c3d::Hash32Ptr (T *k)
 Hash of the pointer. More...
 
SimpleName c3d::HashStr (const c3d::string_t &str)
 Hash of the string. More...
 
SimpleName c3d::HashStr (const char *c_str)
 Hash of the string. More...
 
SimpleName c3d::HashStr (const wchar_t *w_str)
 Hash of the string. More...
 
const StrHash c3d::NullStrHash (0, StrHash::htp_undef)
 Hash of the empty string. More...
 
const StrHash c3d::UndefStrHash (SimpleName(-1), StrHash::htp_undef)
 Hash for the string absence. More...
 
SimpleName c3d::Hash32SN (SimpleName k1, SimpleName k2)
 Hash of two simple names. More...
 

Variables

const SimpleName c3d::SIMPLENAME_MAX = size_t(SYS_MAX_UINT32)
 Maximum allowable simple name.
 
const SimpleName c3d::UNDEFINED_SNAME = size_t(SYS_MAX_UINT32)
 A value is used as "undefined", not yet assigned name.
 
const SimpleName c3d::INIT_HASH32_VAL = size_t( 31415926 )
 The initial value for the hash-function.
 
constexpr uint32 c3d::GOLDENRATIO = 0x9e3779b9
 Golden section - an arbitrary number for hash-function.
 

Detailed Description

Hash-function with probability of collisions 1/(2^32).