Java Integer Array Convert To intArray2HashCode(int[] xs)

Here you can find the source of intArray2HashCode(int[] xs)

Description

int Array Hash Code

License

Apache License

Declaration

public static int intArray2HashCode(int[] xs) 

Method Source Code

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

public class Main {
    public static int intArray2HashCode(int[] xs) {
        int hc = 0;

        for (int i = 0; i < xs.length; ++i) {
            hc = 31 * hc + xs[i];//w w w . ja v a 2s  .  c  om
        }

        return hc;
    }
}

Related

  1. copySignedIntToDoubleArray(int[] src)
  2. copySignedIntToShortArray(int[] src)
  3. intArray2HexString(int[] intArray)
  4. intArray2IntegerArray(int[] array, int newLength)
  5. intArray2Json(int[] array)
  6. intArrayToAddressString(int vals[])