Guest User

Untitled

a guest
Jun 8th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. /* Hash function: Dean Harding (comments section) -
  2. http://programmers.stackexchange.com/questions/49550/which-
  3. hashing-algorithm-is-best-for-uniqueness-and-speed*/
  4.  
  5. unsigned long hash(const char *word)
  6. {
  7. unsigned long hash = 5381;
  8. int c;
  9.  
  10. while ((c = *word++))
  11.  
  12. hash = ((hash << 5) + hash) + c;
  13.  
  14. return hash % HASHSIZE;
  15. }
Add Comment
Please, Sign In to add comment