Stand alone Java implementations of Cuckoo Hashing and Bloom Filters

Included here is a standalone, java implementation of Cuckoo Hashing and of a Bloom Filter.

Instructions for using these classes can be found in the Javadocs for Cuckoo hashing or in the instructions for using a Bloom Filter. Source code is also available.

{ 5 comments… read them below or add one }

Anonymous June 5, 2008 at 3:48 pm

I’m curious about your pseudo-random hash function:
Random r = new Random( objectToHash.hashCode());
int result = r.nextInt(maxBits);
int round = 1;
while( round

Anonymous June 5, 2008 at 3:51 pm

Looks like wordpress ate my comment. I’ll try again.

The added rounds don’t seem to do much to mix the hash value, they just replace the result with the next call to nextInt(). Did you intent this, or should it looks something like:

result ^= r.nextInt(maxBits);

Anonymous June 17, 2008 at 11:26 am

actually, that whole hash function looks off. i suspect it was intended to do something more like
result ^= r.nextInt(1

Anonymous June 17, 2008 at 11:33 am

well, the angle brackets were eaten, but i was wrong in any event.

Nate October 24, 2009 at 12:15 am

Eh? That is a Cuckoo hash set, not a hash table.

Leave a Comment