Class MurmurHash


  • public final class MurmurHash
    extends java.lang.Object
    Taken/modified from http://d3s.mff.cuni.cz/~holub/sw/javamurmurhash/MurmurHash.java
    • Constructor Summary

      Constructors 
      Constructor Description
      MurmurHash()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int hash32​(int[] data, int startPos, int endPos)  
      static int hash32​(int[] data, int startPos, int endPos, int seed)
      Generates 32 bit hash from byte array of the given length and seed.
      static long hashOneLong​(long k_, int seed)  
      static long hashThreeLongs​(long k1, long k2, long k3)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MurmurHash

        public MurmurHash()
    • Method Detail

      • hash32

        public static int hash32​(int[] data,
                                 int startPos,
                                 int endPos,
                                 int seed)
        Generates 32 bit hash from byte array of the given length and seed.
        Parameters:
        data - int array to hash
        length - length of the array to hash
        seed - initial seed value
        Returns:
        32 bit hash of the given array
      • hash32

        public static int hash32​(int[] data,
                                 int startPos,
                                 int endPos)
      • hashOneLong

        public static long hashOneLong​(long k_,
                                       int seed)
      • hashThreeLongs

        public static long hashThreeLongs​(long k1,
                                          long k2,
                                          long k3)