Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Hash function: Dean Harding (comments section) -
- http://programmers.stackexchange.com/questions/49550/which-
- hashing-algorithm-is-best-for-uniqueness-and-speed*/
- unsigned long hash(const char *word)
- {
- unsigned long hash = 5381;
- int c;
- while ((c = *word++))
- hash = ((hash << 5) + hash) + c;
- return hash % HASHSIZE;
- }
Add Comment
Please, Sign In to add comment