protected function adjustKey($key): string
    {
        if (! $this->strictType) {
            $invalidTypes = array('array', 'object', 'boolean', 'NULL');
            $type = gettype($key);
            if (! in_array($type, $invalidTypes)) {
                $key = (string)$key;
            }
        }
        if (! is_string($key)) {
            throw StrictTypeException::keyTypeError($key);
        }
        $key = trim($key);
        if (strlen($key) === 0) {
            throw InvalidArgumentException::emptyKey();
        }
        if (strlen($key) > 255) {
            // key should not be larger
            //  than 255 character
            throw InvalidArgumentException::keyTooLong($key);
        }
        if (preg_match('/[\[\]\{\}\(\)\/\@\:\\\]/', $key) !== 0) {
            // PSR-16 says those characters not allowed
            throw InvalidArgumentException::invalidKeyCharacter($key);
        }
        $key = $this->webappPrefix . $this->weakHash($key);
        return $key;
    }