Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static unsigned long
- sdbm(str)
- unsigned char *str;
- {
- unsigned long hash = 0;
- int c;
- while (c = *str++)
- hash = c + (hash << 6) + (hash << 16) - hash;
- return hash;
- }
- newHash = the character (c) + (previousHashValue * 2^6) +
- (previousHashValue * 2^16) -
- previousHashValue**
- previousHashValue = newHash
Add Comment
Please, Sign In to add comment