title: Cumulative string collection hashing
body: <p>is there an algorithm available for Java that will allow me to keep adding String objects and removing old ones such that if I added a <code>String</code> and then removed it later, the integer hash would be the same?</p>
  
  <p>Edit: the strings in the hash are unique.</p>
  
  <p>Some pseudocode:</p>
  
  <pre><code>h = hash
  add(h, "hi!") == 51;
  add(h, "hello again!") == 532;
  rem(h, "hello again!") == 51;
  </code></pre>
  
  <p>I know you can do it using Java collections, but the default implementations have to keep going over the entire collection to collect the hashcodes. This is really inefficient for large collections. I don't mind using an external library if one exists.</p>
  
  <p>Thanks in advance,<br />
  Chris</p>