3 ms·
Yes exactly. Actually you just need one 64-bit hash to generate all the hashes needed by the Bloom filter. And the somewhat slow modulo operation can be replace
by thomasmg 5y ago
Yes exactly. Actually you just need one 64-bit hash to generate all the hashes needed by the Bloom filter. And the somewhat slow modulo operation can be replaced with multiply+shift (fastRange). See e.g. https://github.com/FastFilter/fastfilter_cpp/blob/master/src/bloom/bloom.h#L149 https://github.com/FastFilter/fastfilter_cpp/blob/master/src...
for (int i = 0; i < k; i++) {
data[fastRange(a, data.length)] |= getBit(a);
a += b;
}