4

I am looking for an implementation of the Rabin Hash Function in Java, Can anyone recommend a fast library?


Update: I've just tested the library here.

It takes ~2200ms to hash 1mm random urls on my 2GHz processor.

This is certainly good enough for my needs, however I will test another library when I get a monent and post the results here.

Joel
  • 29,538
  • 35
  • 110
  • 138
  • 1
    If there are some libraries that you've already tried, but they aren't fast enough, you might want to list them to avoid them being suggested to you again. – Bill the Lizard Oct 17 '09 at 12:53
  • 1
    I've not tried any yet myself. But if i do any comparisons I'll post the results here. – Joel Oct 17 '09 at 12:54
  • It would be nice if you could elaborate your questions a bit more or provide links. I suppose you want to compute *Rabin fingerprints* (http://en.wikipedia.org/wiki/Rabin_fingerprint)? – starblue Oct 18 '09 at 10:01
  • Pretty much yes. THe Rabin hash function allows you to produce hash functions with provably small co-incidence of collision between any two strings, proportional to 1/2^numkeydigits. There are few libraries that pop up when you do a google, i was simply wondering if anyone could recomend any of them from previous experience. – Joel Oct 18 '09 at 12:52

2 Answers2

4

I've not used it myself, but you can try the Rabin Hash Function project on Source Forge.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
4

Here's my Java implementation.

http://code.google.com/p/rabinfingerprint/

It also includes arbitrarily large irreducible polynomials (using BigIntegers).

Bill Dwyer
  • 156
  • 1
  • 4