A Bloom Filter needs k hash functions, which return a value between 0 and m (m is the length of the bit array).
I have to implement such a bloom filter and I already read some theoretical papers about those filter (how they work, how many hash functions you need, how the error behaves etc.)
Now I have two questions about hash functions:
- How do I find k hash functions – which hash functions should I use?
- How do I find hashs functions which return a value between 0 and m? Alternatively, how can I map the output of a hash function to the range 0-m?
You can use this – http://en.wikipedia.org/wiki/Universal_hashing