|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.JenkinsHash
public class JenkinsHash
lookup3.c, by Bob Jenkins, May 2006, Public Domain. lookup3.c You can use this free for any purpose. It's in the public domain. It has no warranty. Produces 32-bit hash for hash table lookup.
Constructor Summary | |
---|---|
JenkinsHash()
|
Method Summary | |
---|---|
static int |
hash(byte[] bytes,
int initval)
Alternate form for hashing an entire byte array |
static int |
hash(byte[] key,
int nbytes,
int initval)
taken from hashlittle() -- hash a variable-length key into a 32-bit value |
static void |
main(String[] args)
Compute the hash of the specified file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JenkinsHash()
Method Detail |
---|
public static int hash(byte[] bytes, int initval)
bytes
- initval
-
public static int hash(byte[] key, int nbytes, int initval)
key
- the key (the unaligned variable-length array of bytes)nbytes
- number of bytes to include in hashinitval
- can be any integer value
public static void main(String[] args) throws IOException
args
- name of file to compute hash of.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |