krati.util
Class MurmurHashFunction

java.lang.Object
  extended by krati.util.MurmurHashFunction
All Implemented Interfaces:
HashFunction<byte[]>

public final class MurmurHashFunction
extends Object
implements HashFunction<byte[]>

This is a very fast, non-cryptographic hash suitable for general hash-based lookup. See http://murmurhash.googlepages.com/ for more details.

The C version of MurmurHash 2.0 found at that site was ported to Java by Andrzej Bialecki (ab at getopt org).


Field Summary
 
Fields inherited from interface krati.util.HashFunction
MAX_HASH_CODE, MIN_HASH_CODE, NON_HASH_CODE
 
Constructor Summary
MurmurHashFunction()
           
 
Method Summary
 long hash(byte[] buffer)
          See hash(byte[] buffer, long initialValue)
static int hash(byte[] data, int seed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MurmurHashFunction

public MurmurHashFunction()
Method Detail

hash

public static int hash(byte[] data,
                       int seed)

hash

public final long hash(byte[] buffer)
See hash(byte[] buffer, long initialValue)

Specified by:
hash in interface HashFunction<byte[]>
Parameters:
buffer - Byte array that we are hashing on.
Returns:
Hash value for the buffer.


Copyright © 2011. All Rights Reserved.