Created
May 15, 2013 13:46
-
-
Save brbsh/5584101 to your computer and use it in GitHub Desktop.
Implentation of JH (Jenkins Hash function http://en.wikipedia.org/wiki/Jenkins_hash_function) in PAWN
This file contains 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
stock Jenkins_Hash(string[]) | |
{ | |
new hash; | |
for(new i; string[i]; i++) | |
{ | |
hash += string[i]; | |
hash += (hash << 10); | |
hash ^= (hash >> 6); | |
} | |
hash += (hash << 3); | |
hash ^= (hash >> 11); | |
hash += (hash << 15); | |
return hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment