14 lines
190 B
C
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;
|
|
}
|
|
|