2007-04-24 20:13:46 UTC
I was looking for bloom filter code and stumbled upon your project. I noticed that your code doesn't work quite right -- you use hashCode() on an integer object to repeatedly generate new indices to set as 1 in the getHash(int, int) function. At least in the version of Java I'm using, if you call hashCode() on an integer, it just returns that integer, so all of your different hash functions end up giving you the same index. As a quick fix I changed it to change the produced hashes into strings and call hashCode() on each string. That will give you a series of unique hashes.