src/Common/Util/MapUtil.php
public static function stringToKey(string $string): int {
        $key = 0;
        for ($i = 0; $i < \strlen($string); $i++) {
            $char = $string[$i];
            $key += \ord($char);
        }
        return $key;
    }
public static function stringToKey(string $string): int {
        $key = 0;
        for ($i = 0; $i < \strlen($string); $i++) {
            $char = $string[$i];
            $key += \ord($char);
        }
        return $key;
    }
public static function stringToKey ( string $ string ) : int { $ key = 0 ; for ( $ i = 0 ; $ i < \ strlen ( $ string ) ; $ i ++ ) { $ char = $ string [ $ i ] ; $ key += \ ord ( $ char ) ; } return $ key ; }
converts a string to a hash map key by summing all
ASCII values of each character.

@param string $string
@return int
converts a string to a hash map key by summing all ASCII values of each character .