Hash 함수 모음
Posted by Go crazy for anything that will make you smile.
// RS Hash Function unsigned int RSHash(const std::string& str) { unsigned int b = 378551; unsigned int a = 63689; unsigned int hash = 0; for(std::size_t i = 0; i < str.length(); i++) { hash = hash * a + str[i]; a = a * b; } return (hash & 0x7FFFFFFF); } // JS Hash Function unsigned int JSHash(const std::string& str) { unsigned int hash = 1315423911; for(std::size_t i = 0; i < str.length(); i++)..