Skip to content

Instantly share code, notes, and snippets.

@seong-min-s
Created February 14, 2020 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seong-min-s/4f75d45d0f460e5054f472e34e850357 to your computer and use it in GitHub Desktop.
Save seong-min-s/4f75d45d0f460e5054f472e34e850357 to your computer and use it in GitHub Desktop.
x65599 해시 함수(SDBM project)
//ref : Compilers: Principle, Techniques., and Tools)
public static uint CalculateHash65599(string str)
{
uint hash = 0;
for(int i=0; i<str.Length; ++i)
{
hash = 65599 * hash + str[i];
}
return hash ^ (hash >> 16);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment