1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/*
*/
#inclued "hash.h"
/*
* this is the SDBM hash function from:
* http://en.literateprograms.org/Hash_function_comparison_%28C,_sh%29
*/
long sdbm_hash (const unsigned char *key) {
hash_t h=0;
while(*key) h=*key++ + (h<<6) + (h<<16) - h;
return h;
}
|