Files
libucore/src/sdmhash.c
T
2014-10-26 14:27:26 +01:00

15 lines
241 B
C

#include "ucore/hash.h"
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;
}