title: Java: simplest integer hash
body: <p>I need a quick hash function for integers:</p>
  
  <pre><code> int hash(int n) { return ...; }
  </code></pre>
  
  <p>Is there something that exists already in Java?</p>
  
  <p>The minimal properties that I need are:</p>
  
  <ul>
  <li><code>hash(n) &amp; 1</code> does not appear periodic when used with a bunch of consecutive values of n.</li>
  <li><code>hash(n) &amp; 1</code> is approximately equally likely to be 0 or 1.</li>
  </ul>