function hashCode(key) {
  const array = Array.from(`${key}${typeof key}`);
  return array.reduce((hashCode, char, position) => {
    return hashCode + BigInt(char.codePointAt(0)) * (2n ** (BigInt(position) * 20n));
  }, 0n);
}
Calculates polynomial hash code that maps a key (value) to an integer (unbounded).
It uses a 20 bit offset to avoid Unicode value overlaps
@param {any} key
@returns {BigInt} returns big integer (unbounded) that maps to the key