Generate a salt string compatible with this adapter.

@param string $input
Optional random 48-bit string to use when generating the salt.
@return string
Returns the generated salt string.
540192
public function genSalt($input = null)
    {
        if (!$input) {
            $input = $this->_getRandomBytes(6);
        }

        $identifier = 'sha1';
        $salt = $this->_encode64($input, 6);

        return '$' . $identifier . '$' . $this->_iterationCount . '$' . $salt . '$';
    }
405420
public static function hash($input)
    {
        if (Symphony::Log()) {
            Symphony::Log()->pushDeprecateWarningToLog('MD5::hash()', 'PBKDF2::hash()', array(
                'message-format' => __('The use of `%s` is strongly discouraged due to severe security flaws.'),
            ));
        }
        return md5($input);
    }
563538
public function getLength($input)
    {
        if (is_scalar($input)) {
            if ($this->countByChars) {
                return mb_strlen($input, $this->charset);
            } else {
                return strlen($input);
            }
        } elseif (is_array($input) || $input instanceof \Countable) {
            return count($input);
        } else {
            return false;
        }
    }
1104684
protected static function base64UrlEncode($input) {
    $str = strtr(base64_encode($input), '+/', '-_');
    $str = str_replace('=', '', $str);
    return $str;
  }
94543
protected function _fromBase64url($input)
    {
        $remainder = strlen($input) % 4;
        if ($remainder)
        {
            $padlen = 4 - $remainder;
            $input .= str_repeat('=', $padlen);
        }

        return base64_decode(strtr($input, '-_', '+/'));
    }
420351
protected function md4Encrypt($input)
    {
        $input = $this->convertTo16bit($input);

        return function_exists('hash') ? hex2bin(hash('md4', $input)) : mhash(MHASH_MD4, $input);
    }
309449
public static function bin2ascii($input)
    {
        $hextab = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        $result = '';

        for ($x = 0; $x < strlen($input); $x++) {
            $result .= $hextab[ord($input[$x]) % 62];
        }

        return $result;
    }
1245427
public static function formatStringToMethodName(string $input) : string
    {
        $methodName = implode('', array_map('ucfirst', explode('_', strtolower($input))));

        return $methodName;
    }
1317404
public static function convert($input = STDIN)
    {
        $stream = fopen('php://temp', 'rw');

        foreach ($_SERVER as $key => $value) {
            if (0 === strpos($key, 'HTTP_')) {
                $key = str_replace('_', '-', strtolower(substr($key, 5)));
                fwrite($stream, "$key: $value\r\n");
            } elseif (in_array($key, ['CONTENT_LENGTH', 'CONTENT_MD5', 'CONTENT_TYPE'])) {
                $key = str_replace('_', '-', strtolower($key));
                fwrite($stream, "$key: $value\r\n");
            }
        }

        fwrite($stream, "\r\n");

        stream_copy_to_stream($input, $stream);

        rewind($stream);

        return new StreamedPart($stream);
    }
473411
public static function encode($input, $serialized = false)
    {
        // use Base64 encoding to workaround issues with invalid
        // or null characters in serialized string (#1489142)
        if ($serialized) {
            return base64_encode(serialize($input));
        }

        if (is_object($input)) {
            foreach (get_object_vars($input) as $idx => $value) {
                $input->$idx = self::encode($value);
            }
            return $input;
        }
        else if (is_array($input)) {
            foreach ($input as $idx => $value) {
                $input[$idx] = self::encode($value);
            }

            return $input;
        }

        return utf8_encode($input);
    }
741836
private function withParam( string$input )
	{
		return str_replace('$_FLAG_$',"__HTSL_CTRL_FLAG_{$this->id}__",preg_replace_callback('/(?<!%)%s((?:\\/.+?(?<!\\\\)\\/.+?(?<!\\\\)\\/)+)?/',function( array$matches ){
			$param= $this->param;

			if( isset($matches[1]) ){
				array_map(...[
					function($replacer)use(&$param){
						list($pattern,$replacement,)= preg_split('/(?<!\\\\)\\//',$replacer);
						$param= preg_replace(...[
							"/$pattern/",
							preg_replace('/^\\\\_$/','',$replacement),
							$param,
						]);
					},
					preg_split(
						'/(?<!\\\\)\\/\\//'
						,
						trim($matches[1],'/')
					),
				]);
			}
			return $param;
		},$input));
	}
464340
private function tokenize($input, $limit = -1)
    {
        $chunks = preg_split('!\s+!', $input, $limit);
        if ($limit !== -1 && count($chunks) != $limit) {
            $chunks += array_fill(count($chunks), $limit, '');
        }
        return $chunks;
    }
707241
protected function convertToValidCharacters(string $input): string
    {
        $converted = preg_replace(
            '/[\\p{C}\\p{Z}\\p{M}]+/u',
            '',
            \Normalizer::normalize(str_replace('～', '〜', $input), \Normalizer::FORM_KC)
        );
        if ($this->isRegExp($converted)) {
            $converted = trim($converted, '/');
        }
        return $converted;
    }
469944
public function encrypt($input)
    {
        if (! $input) {
            return $input;
        }

        $methods = $this->getEncryptionMethods();
        $method  = reset($methods);
        $mkey    = key($methods);

        if ('mcrypt' == $method) {
            $result = $this->encryptMcrypt($input);
        } elseif ('null' == $method) {
            $result = $input;
        } else {
            $result = $this->encryptOpenSsl($input, $method);
        }

        return ":$mkey:" . base64_encode($result);
    }
952170
protected function convertNegativeTo($input)
    {
        $res = $this->convertPositiveTo(substr($input, 1));

        $res = strtr($res, static::POSITIVE_CHARS, static::NEGATIVE_CHARS);

        if (strlen($res) < 5) {
            $res = '/' . $res;
        } elseif ($res[0] !== '!') {
            $res = '*' . $res;
        }

        return $res;
    }
404173
public static function studly($input)
    {
        $input = mb_convert_case($input, \MB_CASE_TITLE, 'UTF-8');
        $input = str_replace(array('-', '_'), ' ', $input);
        $input = str_replace(' ', '', $input);

        return $input;
    }
1305240
public function canonicalize($input)
    {
        $strippedInput = str_replace(' ', '', $input);
        if (!preg_match('/^\d{4}[A-Za-z]{2}$/', $strippedInput)) {
            return $input;
        }

        return implode(' ', [substr($strippedInput, 0, 4), mb_strtoupper(substr($strippedInput, -2, 2))]);
    }