Java Hash Calculate hashJava64(byte[] byteList)

Here you can find the source of hashJava64(byte[] byteList)

Description

hash Java

License

Open Source License

Declaration

public static long hashJava64(byte[] byteList) 

Method Source Code

//package com.java2s;
/**//from w  w  w. ja va  2 s .  c  om
 * Copyright 2014 Expedia, Inc. All rights reserved.
 * EXPEDIA PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

public class Main {
    private static final long BITMASK_POSITIVE_64 = ~0x8000000000000000L;

    public static long hashJava64(byte[] byteList) {
        if (byteList == null) {
            return 0;
        }

        long hash = 1;
        for (byte element : byteList) {
            hash = 31 * hash + element;
        }

        return hash & BITMASK_POSITIVE_64;
    }
}

Related

  1. hashHsieh(int init, Object... vals)
  2. hashInt(final int v)
  3. hashIntArray(int seed, int[] data, int offset, int len)
  4. hashIt(Object o)
  5. hashJava32(byte[] byteList)
  6. hashJenkins(int init, Object... vals)
  7. hashLong(long id)
  8. hashLong(long l)
  9. hashMapCapacity(final int nElements)