function stringHash(string, hash) {
    let char = 0
    while (char < string.length) {
      hash = (hash << 5) - hash + string.charCodeAt(char++) | 0 // bitwise or ensures we have a 32-bit int
    }
    return hash
  }
based on https://gist.github.com/hyamamoto/fd435505d29ebfa3d9716fd2be8d42f0,
derived from Java's string hashcode implementation
@param {string} string
@param {number} hash
@returns {number}