Created
February 14, 2020 02:20
-
-
Save seong-min-s/4f75d45d0f460e5054f472e34e850357 to your computer and use it in GitHub Desktop.
x65599 해시 함수(SDBM project)
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
//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