PasswordHash::CheckPassword()publicWP 1.0

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$PasswordHash = new PasswordHash();
$PasswordHash->CheckPassword( $password, $stored_hash );
$password (обязательный)
-
$stored_hash (обязательный)
-

Код PasswordHash::CheckPassword() WP 6.5.2

function CheckPassword($password, $stored_hash)
{
	if ( strlen( $password ) > 4096 ) {
		return false;
	}

	$hash = $this->crypt_private($password, $stored_hash);
	if ($hash[0] === '*')
		$hash = crypt($password, $stored_hash);

	# This is not constant-time.  In order to keep the code simple,
	# for timing safety we currently rely on the salts being
	# unpredictable, which they are at least in the non-fallback
	# cases (that is, when we use /dev/urandom and bcrypt).
	return $hash === $stored_hash;
}