title: Hash 32bit int to 16bit int?
body: <p>What are some simple ways to hash a 32-bit integer (e.g. IP address, e.g. Unix time_t, etc.) down to a 16-bit integer?</p>
  
  <p>E.g. <code>hash_32b_to_16b(0x12345678)</code> might return <code>0xABCD</code>.</p>
  
  <p>Let's start with this as a horrible but functional example solution:</p>
  
  <pre><code>function hash_32b_to_16b(val32b) {
      return val32b % 0xffff;
  }
  </code></pre>
  
  <p>Question is specifically about JavaScript, but feel free to add any language-neutral solutions, preferably without using library functions.</p>
  
  <p>The context for this question is generating unique IDs (e.g. a 64-bit ID might be composed of several 16-bit hashes of various 32-bit values).  Avoiding collisions is important.</p>
  
  <p>Simple = good.  Wacky+obfuscated = amusing.</p>