Package com.linkedin.alpini.base.hash
Class JenkinsHashFunction
- java.lang.Object
-
- com.linkedin.alpini.base.hash.JenkinsHashFunction
-
- All Implemented Interfaces:
HashFunction
public final class JenkinsHashFunction extends java.lang.Object implements HashFunction
Hash algorithm by Bob Jenkins, 1996. You may use this code any way you wish, private, educational, or commercial. It's free. See: http://burtleburtle.net/bob/hash/doobs.html Use for hash table lookup, or anything where one collision in 2^^32 is acceptable. Do NOT use for cryptographic purposes. Reimplementation from http://burtleburtle.net/bob/c/lookup3.c to match test vectors
-
-
Constructor Summary
Constructors Constructor Description JenkinsHashFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longhash(byte[] key, int numBuckets)longhash(long key, int numBuckets)longhash(java.nio.ByteBuffer buf)longhash(java.nio.ByteBuffer buf, int off, int len)inthashlittle(java.nio.ByteBuffer k, int initval)longhashlittle2(java.nio.ByteBuffer k, long initval)inthashword(java.nio.IntBuffer k, int initval)longhashword2(java.nio.IntBuffer k, long initval)
-
-
-
Method Detail
-
hashword
public int hashword(java.nio.IntBuffer k, int initval)
-
hashword2
public long hashword2(java.nio.IntBuffer k, long initval)
-
hashlittle
public int hashlittle(java.nio.ByteBuffer k, int initval)
-
hashlittle2
public long hashlittle2(java.nio.ByteBuffer k, long initval)
-
hash
public long hash(java.nio.ByteBuffer buf)
- Specified by:
hashin interfaceHashFunction
-
hash
public long hash(java.nio.ByteBuffer buf, int off, int len)- Specified by:
hashin interfaceHashFunction
-
hash
public long hash(byte[] key, int numBuckets)- Specified by:
hashin interfaceHashFunction
-
hash
public long hash(long key, int numBuckets)- Specified by:
hashin interfaceHashFunction
-
-