diff options
Diffstat (limited to 'sdbm.c')
-rw-r--r-- | sdbm.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -0,0 +1,10 @@ +#include "sdbm.h" + +unsigned long sdbm(char *str) { + unsigned long hash = 0; + int c; + while(c = *str++) { + hash = c + (hash << 6) + (hash << 16) - hash; + } + return hash; +} |