com.netflix.zeno.fastblob.record
Class SegmentedByteArrayHasher

java.lang.Object
  extended by com.netflix.zeno.fastblob.record.SegmentedByteArrayHasher

public class SegmentedByteArrayHasher
extends java.lang.Object

This class performs a fast murmurhash3 on a sequence of bytes.

MurmurHash is a high quality hash algorithm for byte data:

http://en.wikipedia.org/wiki/MurmurHash


Constructor Summary
SegmentedByteArrayHasher()
           
 
Method Summary
static int hashCode(ByteDataBuffer data)
           
static int hashCode(ByteData data, int offset, int len)
          MurmurHash3.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SegmentedByteArrayHasher

public SegmentedByteArrayHasher()
Method Detail

hashCode

public static int hashCode(ByteDataBuffer data)

hashCode

public static int hashCode(ByteData data,
                           int offset,
                           int len)
MurmurHash3. Adapted from:

https://github.com/yonik/java_util/blob/master/src/util/hash/MurmurHash3.java

On 11/19/2013 the license for this file read:

The MurmurHash3 algorithm was created by Austin Appleby. This java port was authored by Yonik Seeley and is placed into the public domain. The author hereby disclaims copyright to this source code.

This produces exactly the same hash values as the final C++ version of MurmurHash3 and is thus suitable for producing the same hash values across platforms.

The 32 bit x86 version of this hash should be the fastest variant for relatively short keys like ids.

Note - The x86 and x64 versions do _not_ produce the same results, as the algorithms are optimized for their respective platforms.

See http://github.com/yonik/java_util for future updates to this file.