Hacker News new | ask | show | jobs
by makmanalp 4616 days ago
Question, instead of using two hash functions, why not use just a single function but use a = hash(foo) and b = hash(foo+"something")? A well distributed hash function should give drastically different results for a and b for different values of foo, which is what we want, correct?
2 comments

It's standard to have at least two hashing functions. You can then simulate having x hash functions simply by combining those two.[1]

But, your question is entirely valid and I'm not really sure why you couldn't do that. It might simply be that the kinds of hash functions used in bloom filters (non-cryptographic) are not well distributed.

[1]: http://citeseer.ist.psu.edu/viewdoc/download;jsessionid=4060...

Fascinating, thank you! I'll take a look at the paper when I get back home.
That's what I do, and it works just fine. I was going to raise this point but you beat me to it.