Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int to_hash(const string &key) {
- int hash_value = 0;
- for(char i : key) {
- hash_value = 7 * hash_value + i;
- }
- return abs(hash_value % 1000001);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement