9 lines
178 B
C
9 lines
178 B
C
unsigned long sdbm(char *str) {
|
|
unsigned long hash = 0;
|
|
|
|
for (int c = *str; c != 0; c = *str++)
|
|
hash = c + (hash << 6) + (hash << 16) - hash;
|
|
|
|
return hash;
|
|
}
|