Files
libucore/src/ucore_sdmhash.c
T
Nils O. Selåsdal cef7e3b057 prefix hash functions with uc_
fix prototype for hashuint
2012-11-01 00:01:53 +01:00

13 lines
198 B
C

unsigned long
uc_sdbmhash(const unsigned char *str)
{
unsigned long hash = 0;
unsigned int c;
while ((c = *str++))
hash = c + (hash << 6) + (hash << 16) - hash;
return hash;
}