/[Apache-SVN]/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/JenkinsHash.java
ViewVC logotype

Diff of /hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/util/JenkinsHash.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 689888, Thu Aug 28 16:49:51 2008 UTC revision 693597, Tue Sep 9 20:36:49 2008 UTC
# Line 43  public class JenkinsHash { Line 43  public class JenkinsHash {
43    private static long BYTE_MASK = 0x00000000000000ffL;    private static long BYTE_MASK = 0x00000000000000ffL;
44    
45    private static long rot(long val, int pos) {    private static long rot(long val, int pos) {
46      return ((long)(Integer.rotateLeft(      return ((Integer.rotateLeft(
47          (int)(val & INT_MASK), pos)) & INT_MASK);          (int)(val & INT_MASK), pos)) & INT_MASK);
48    }    }
49    
# Line 93  public class JenkinsHash { Line 93  public class JenkinsHash {
93     * <p>Use for hash table lookup, or anything where one collision in 2^^32 is     * <p>Use for hash table lookup, or anything where one collision in 2^^32 is
94     * acceptable.  Do NOT use for cryptographic purposes.     * acceptable.  Do NOT use for cryptographic purposes.
95    */    */
96      @SuppressWarnings("fallthrough")
97    public static int hash(byte[] key, int nbytes, int initval) {    public static int hash(byte[] key, int nbytes, int initval) {
98      int length = nbytes;      int length = nbytes;
99      long a, b, c;       // We use longs because we don't have unsigned ints      long a, b, c;       // We use longs because we don't have unsigned ints

Legend:
Removed from v.689888  
changed lines
  Added in v.693597

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2