15 lines
241 B
C
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;
|
|
}
|
|
|