function hash(s) {
    let hash = 0;
    let chr;
    if (s.length === 0) return hash;
    for (let i = 0; i < s.length; i++) {
      chr   = s.charCodeAt(i);
      hash  = ((hash << 5) - hash) + chr;
      hash |= 0; // Convert to 32bit integer
    }
    return hash;
}
simple hash implementation based on https://stackoverflow.com/a/7616484/1749888
@param {string} s - string to hash
@returns {number} numerical hash code