• Stars
    star
    116
  • Rank 303,894 (Top 6 %)
  • Language
    Java
  • Created over 13 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

32 and 64 bit implementations of murmurhash2

murmurhash-java

This is an implementation by Viliam Holub of the fast non-cryptographic murmurhash2 algorithm.

It is written in Java and is implemented in both 32 and 64-bit versions.

If you want the latest in the world of murmur, check out Guava's Hashing class, which has 32 and 128 bit implementations of murmur3.

building

Build a package with maven:

mvn package

Run the tests:

mvn test

public api

public final class MurmurHash {
    public static int  hash32(final byte[] data, int length);
    public static long hash64(final byte[] data, int length);
    public static int  hash32(final byte[] data, int length, int seed);
    public static long hash64(final byte[] data, int length, int seed);
    public static int  hash32(final String text);
    public static long hash64(final String text);
    public static int  hash32(final String text, int from, int length);
    public static long hash64(final String text, int from, int length);
}

author

This code was released by Viliam into the public domain. More information is here.