Skip to content

Instantly share code, notes, and snippets.

@brbsh
Created May 15, 2013 13:46
Show Gist options
  • Save brbsh/5584101 to your computer and use it in GitHub Desktop.
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
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