Android Byte Array Hash hashCode(byte[] data)

Here you can find the source of hashCode(byte[] data)

Description

hash Code

License

Open Source License

Declaration

public static int hashCode(byte[] data) 

Method Source Code

//package com.java2s;

public class Main {
    public static int hashCode(byte[] data) {
        if (data == null) {
            return 0;
        }/*from   w w w. ja  va  2  s .co m*/

        int i = data.length;
        int hc = i + 1;

        while (--i >= 0) {
            hc *= 257;
            hc ^= data[i];
        }

        return hc;
    }
}

Related

  1. hash(String algorithm, byte[] data)
  2. getByteArrayHash(byte[] value)