Files
libucore/src/ucore_djbhash.c
T
2012-10-29 23:07:32 +01:00

14 lines
190 B
C

#include "ucore_hash.h"
uint32_t
uc_djbhash(const char *str)
{
uint32_t hash = 5381;
int c;
while ((c = *str++))
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
return hash;
}