What would be the fastest and more robust (in terms of uniqueness) way for implementing a method like
public abstract String hash(String[] values); >
public abstract String hash(String[] values);
Definitely don't use plain addition due to its linearity properties, but you can modify your code just slightly to achieve very good dispersion.
public String hash(String[] values) { long result = 17; for (String v:values) result = 37*result + v.hashCode(); return String.valueOf(result); }