Created
December 23, 2015 14:56
-
-
Save mrahul17/8cbe4a3f55aca6673e09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from http://stackoverflow.com/questions/98153/whats-the-best-hashing-algorithm-to-use-on-a-stl-string-when-using-hash-map | |
unsigned int hash(const char* s, unsigned int seed = 0) | |
{ | |
unsigned int hash = seed; | |
while (*s) | |
{ | |
hash = hash * 101 + *s++; | |
} | |
return hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment