1 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
3 * Contains hashing code.
5 * \author Pierre Terdiman
8 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
10 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
15 #define HashSize(n) ((udword)1<<(n))
16 #define HashMask(n) (HashSize(n)-1)
18 ICECORE_API udword Hash(const char* str);
19 ICECORE_API udword Hash(ubyte* k, udword length, udword initval);
22 inline_ unsigned int Hash32Bits_0(unsigned int key)
36 inline_ int Hash32Bits_1(int key)
48 inline_ __int64 Hash64Bits_0(__int64 key)
61 inline_ __int64 Hash64Bits_1(__int64 key)
63 __int64 c1 = 0x6e5ea73858134343L;
64 __int64 c2 = 0xb34e8f99a2ec9ef5L;
65 key ^= ((c1 ^ key) >> 32);
67 key ^= ((c2 ^ key) >> 31);
69 key ^= ((c1 ^ key) >> 32);
73 inline_ udword Hash(udword id0, udword id1)
75 return Hash32Bits_1( (id0&0xffff)|(id1<<16) );
78 #endif // ICEHASHING_H