Java Hash Calculate calculateHashCode(byte a[])

Here you can find the source of calculateHashCode(byte a[])

Description

calculate Hash Code

License

Apache License

Declaration

private static int calculateHashCode(byte a[]) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static int calculateHashCode(byte a[]) {
        if (a == null)
            return 0;
        int result = 1;
        for (byte b : a) {
            result = 31 * result + b;/*from  w w  w  .j  a  va2 s . c  om*/
        }
        return result;
    }
}

Related

  1. calculateHash(int x, int y)
  2. calculateHash(Long... ids)
  3. calculateHash(String str)
  4. getHash(byte[] bytes)
  5. getHash(byte[] bytes)
  6. getHash(byte[] data)
  7. getHash(byte[] data)