title: Simple string-based one-way hashing algorithm for JavaScript
body: <p>I've been searching around for a simple-lightweight hashing algorithm for JavaScript. I did find this numerically-based answer on Stack Overflow <a href="https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery">here</a>.</p>
  
  <p>Unfortunately, I am unable to use this since it's numerically based and I'll need to use this hash as a unique index elsewhere in my code. Often this function returns negative numbers and that would be a big no-no (try <code>'hello world!'.hashCode()</code> from the snippet linked above to see what I mean).</p>
  
  <p>I've been tempted to use the md5 hashing libraries out there for JS but they're simply to bulky for my purpose and encryption libraries (such as <a href="http://crypto.stanford.edu/sjcl/" rel="nofollow noreferrer">this</a>) are overkill. </p>
  
  <p>It's worth noting that the information within this hash isn't sensitive in anyway and it wouldn't necessarily matter if it was decrypted. The purpose of this function would be to simply generate fixed-length output data that acts as a shortened reference to the original data that I would pass in.</p>
  
  <p>Any help, tips and comments are much appreciated :)</p>