Yoast\WP\SEO\Config

Wincher_PKCE_Provider::getRandomPkceCode()protectedYoast 1.0

Returns a new random string to use as PKCE code_verifier and hashed as code_challenge parameters in an authorization flow. Must be between 43 and 128 characters long.

Метод класса: Wincher_PKCE_Provider{}

Хуков нет.

Возвращает

Строку.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->getRandomPkceCode( $length );
$length(int)
Length of the random string to be generated.
По умолчанию: 64

Код Wincher_PKCE_Provider::getRandomPkceCode() Yoast 22.4

protected function getRandomPkceCode( $length = 64 ) {
	return \substr(
		\strtr(
			// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
			\base64_encode( \random_bytes( $length ) ),
			'+/',
			'-_'
		),
		0,
		$length
	);
}