hashFunction(key) {
    if (typeof key === 'number') {
      return this.hashCodeToIndex(HashMap.hashCodeForNumber(key));
    }
    return this.hashCodeToIndex(this.hashFunctionForString(key));
  }
A hash function converts keys into array indices
@param {any} key
@returns {BigInt} array index given the bucket size