28 #ifndef _CHAINCON_STRINGHASH_H_ 29 #define _CHAINCON_STRINGHASH_H_ 36 #include "chomp/system/config.h" 46 int_t len = s. size ();
50 return static_cast<int_t
> (s [0]) << 4;
53 return ((static_cast<int_t> (s [0]) & 0x5555u) << 12) ^
54 ((static_cast<int_t> (s [1]) & 0xAAAAu));
58 return ((static_cast<int_t> (s [0]) & 0x9249u) << 16) ^
59 ((static_cast<int_t> (s [len >> 1]) & 0x2492u)
61 ((static_cast<int_t> (s [len - 1]) & 0x4924u)) ^
71 int_t len = s. size ();
75 return static_cast<int_t
> (s [0]) << 7;
78 return ((static_cast<int_t> (s [0]) & 0xAAAAu) << 5) ^
79 ((static_cast<int_t> (s [1]) & 0x5555u) << 15);
83 return ((static_cast<int_t> (s [len - 1]) & 0xC30Cu) << 15) ^
84 ((static_cast<int_t> (s [0]) & 0x30C3u) << 7) ^
85 ((static_cast<int_t> (s [len >> 1]) & 0x0C30u)
92 #endif // _CHAINCON_STRINGHASH_H_ int_t hashkey1(const std::string &s)
Creates a generic hashing key no.
int_t hashkey2(const std::string &s)
Creates a generic hashing key no.