Java Hash String hashCodeOfStringArray(String[] stringArray)

Here you can find the source of hashCodeOfStringArray(String[] stringArray)

Description

hash Code Of String Array

License

Apache License

Declaration

public static int hashCodeOfStringArray(String[] stringArray) 

Method Source Code

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

public class Main {

    public static int hashCodeOfStringArray(String[] stringArray) {
        if (stringArray == null) {
            return 0;
        }/*from ww w .j av a2 s.  c  o m*/
        int hashCode = 17;
        for (int i = 0; i < stringArray.length; i++) {
            String value = stringArray[i];
            hashCode = hashCode * 31 + (value == null ? 0 : value.hashCode());
        }
        return hashCode;
    }
}

Related

  1. hashCode1(String str)
  2. hashCode2(String str)
  3. hashCode64(String s)
  4. hashCode64(String s)
  5. hashCodeIgnoreCase(String a)
  6. hashCodeToString(byte[] hash)
  7. hashCodeToString(long code)
  8. hasHeirarchy(String xpath)
  9. hasHexOrDecLongUrnSuffix(String value)