30 #define MIX_INTEGERS(a,b,c) \
32 a -= b; a -= c; a ^= (c>>13); \
33 b -= c; b -= a; b ^= (a<<8); \
34 c -= a; c -= b; c ^= (b>>13); \
35 a -= b; a -= c; a ^= (c>>12); \
36 b -= c; b -= a; b ^= (a<<16); \
37 c -= a; c -= b; c ^= (b>>5); \
38 a -= b; a -= c; a ^= (c>>3); \
39 b -= c; b -= a; b ^= (a<<10); \
40 c -= a; c -= b; c ^= (b>>15); \
43 #define ui (unsigned int)
45 unsigned int hash(
const unsigned char * key,
unsigned int length,
unsigned int initval)
47 unsigned int a = 0x9e3779b9;
48 unsigned int b = 0x9e3779b9;
49 unsigned int c = initval;
50 unsigned int len = length;
55 a += (key[0] +(ui(key[1])<<8) +(ui(key[2])<<16) +(ui(key[3])<<24));
56 b += (key[4] +(ui(key[5])<<8) +(ui(key[6])<<16) +(ui(key[7])<<24));
57 c += (key[8] +(ui(key[9])<<8) +(ui(key[10])<<16)+(ui(key[11])<<24));
100 unsigned int hash_no_case(
const unsigned char * key,
unsigned int length,
unsigned int initval)
102 unsigned int a = 0x9e3779b9;
103 unsigned int b = 0x9e3779b9;
104 unsigned int c = initval;
105 unsigned int len = length;
110 a += (toupper(key[0]) +(ui(toupper(key[1]))<<8) +(ui(toupper(key[2]))<<16) +(ui(toupper(key[3]))<<24));
111 b += (toupper(key[4]) +(ui(toupper(key[5]))<<8) +(ui(toupper(key[6]))<<16) +(ui(toupper(key[7]))<<24));
112 c += (toupper(key[8]) +(ui(toupper(key[9]))<<8) +(ui(toupper(key[10]))<<16)+(ui(toupper(key[11]))<<24));
123 c+=(ui(toupper(key[10]))<<24);
125 c+=(ui(toupper(key[9]))<<16);
127 c+=(ui(toupper(key[8]))<<8);
131 b+=(ui(toupper(key[7]))<<24);
133 b+=(ui(toupper(key[6]))<<16);
135 b+=(ui(toupper(key[5]))<<8);
140 a+=(ui(toupper(key[3]))<<24);
142 a+=(ui(toupper(key[2]))<<16);
144 a+=(ui(toupper(key[1]))<<8);