11 #ifndef TLX_STRING_HASH_SDBM_HEADER 12 #define TLX_STRING_HASH_SDBM_HEADER 29 while ((c = *str++) != 0) {
30 hash = c + (hash << 6) + (hash << 16) -
hash;
41 return hash_sdbm(reinterpret_cast<const unsigned char*>(str));
49 uint32_t
hash_sdbm(
const unsigned char* str,
size_t size) {
52 hash =
static_cast<unsigned char>(*str++)
53 + (hash << 6) + (hash << 16) - hash;
64 return hash_sdbm(reinterpret_cast<const unsigned char*>(str), size);
80 #endif // !TLX_STRING_HASH_SDBM_HEADER
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
HashCrc32< T > hash
Select a hashing method.
static uint32_t hash_sdbm(const unsigned char *str)
Simple, fast, but "insecure" string hash method by sdbm database from http://www.cse.yorku.ca/~oz/hash.html.