title: Creating a hash from several Java string objects
body: <p>What would be the fastest and more robust (in terms of uniqueness) way for implementing a method like</p>
  
  <pre><code>public abstract String hash(String[] values);
  </code></pre>
  
  <p>The <code>values[]</code> array has 100 to 1,000 members, each of a which with few dozen characters, and the method needs to be run about 10,000 times/sec on a different <code>values[]</code> array each time.</p>
  
  <p>Should a long string be build using a <code>StringBuilder</code> buffer and then a hash method invoked on the buffer contents, or is it better to keep invoking the hash method for each string from <code>values[]</code>?</p>
  
  <p>Obviously a hash of at least 64 bits is needed (e.g., MD5) to avoid collisions, but is there anything simpler and faster that could be done, at the same quality?</p>
  
  <p>For example, what about</p>
  
  <pre><code>public String hash(String[] values)
  {
      long result = 0;
  
      for (String v:values)
      {
          result += v.hashCode();
      }
  
      return String.valueOf(result);
  }
  </code></pre>