diff --git a/DEV.md b/DEV.md index a972a7a..a15d9d8 100644 --- a/DEV.md +++ b/DEV.md @@ -5,4 +5,20 @@ and take it from there. So off we go to top level main.cpp There is an original paper but I'm reading off from wiki for now https://en.wikipedia.org/wiki/Bloom_filter +## Making k hashes +This was the first problem. Just like open addressing hash tables do it. + +Idea is you take 2 hash functions and then use them as +``` +h_i(x) = ( h1(x) + i.h2(x) ) mod m +``` +Then if I say that `gcd(h2(x),m) = 1` then thi will loop over all residues and I have a uniform spread over the range m. + +I can't do h(x) + i as that's a bad idea since it'll be consecutive same with i . h(x) as there will be just equally spaced strides. + +This double hashed func almost behaves like a random number generator. + +## std::hash + +you make a hasher object and them immediately call it