Created
October 25, 2018 22:37
-
-
Save cthornton/79ec60bbe63fc4f5498b8c9222f4a282 to your computer and use it in GitHub Desktop.
Hash function in c++
This file contains hidden or 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
// Example: | |
// | |
// cout << hashString("hello world") << endl; // prints: 1128946856 | |
#include <boost/functional/hash.hpp> | |
int hashString(const string& input) { | |
boost::hash<string> string_hash; | |
return string_hash(input); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment