src/Datastructure/Maps/HashMap.php
private function getBucketIndex($key) {
        /*
         * next, the keys hash is calculated by a
         * private method. Next, the array index
         * (bucket index) is calculated from this hash.
         *
         * Doing this avoids hash collisions.
         */
        $hash = $this->getHash($key);
        $arrayIndex = $this->getArrayIndex($hash);
        return $arrayIndex;
    }
private function getBucketIndex($key) {
        /*
         * next, the keys hash is calculated by a
         * private method. Next, the array index
         * (bucket index) is calculated from this hash.
         *
         * Doing this avoids hash collisions.
         */
        $hash = $this->getHash($key);
        $arrayIndex = $this->getArrayIndex($hash);
        return $arrayIndex;
    }
private function getBucketIndex ( $ key ) { /*
         * next, the keys hash is calculated by a
         * private method. Next, the array index
         * (bucket index) is calculated from this hash.
         *
         * Doing this avoids hash collisions.
         */ $ hash = $ this -> getHash ( $ key ) ; $ arrayIndex = $ this -> getArrayIndex ( $ hash ) ; return $ arrayIndex ; }
returns the bucket array index by using the "division method".

note that the division method has limitations: if the hash function
calculates the hashes in a constant way, the way how keys are created
can be chosen so that they hash to the same bucket. Thus, the worst-case
scenario of having n nodes in one chain would be true.
Solution: use universal hashing

@param $key
@return int
@throws \doganoo\PHPAlgorithms\Common\Exception\InvalidKeyTypeException
@throws \doganoo\PHPAlgorithms\Common\Exception\UnsupportedKeyTypeException
returns the bucket array index by using the division method .