]> git.sesse.net Git - remoteglot-book/blob - hash.cpp
Set parallel merges to a value different from parallel loads.
[remoteglot-book] / hash.cpp
1 #include <farmhash.h>
2 #include <algorithm>
3 #include "hash.h"
4
5 using namespace std;
6
7 int hash_key_to_bucket(const char* s, size_t len, int num_buckets)
8 {
9         len = min<size_t>(len, HASH_PREFIX_BYTES);
10         return util::Fingerprint32(s, len) % num_buckets;
11 }