code: function hash(str) {
    var h = 0;
    if (str.length === 0) {
      return h;
    }
    for (var i = 0; i < str.length; i++) {
      var character = str.charCodeAt(i);
      h = ((h << 5) - h) + character;
      h = h & h; // Convert to 32bit integer
    }
    return h;
  }
docs: Simple hash function which happens to match Java's |String.hashCode()|
  Done like this because I we don't need crypto-security, but do need speed,
  and I don't want to spend a long time working on it.
  @see http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/