wp_verify_fast_hash()
Проверено на WordPress 6.9, обновлено Источник: WordPress Developer Resources.
Сигнатура
wp_verify_fast_hash( string $message, string $hash ): bool
Описание
Функция использует Sodium для хеширования сообщения и сравнения его с хешированным значением. Если хеш не является универсальным, он рассматривается как переносимый хеш phpass для обеспечения обратной совместимости с паролями и ключами безопасности, которые были хешированы с помощью phpass до WordPress 6.8.0.
Оригинал (английский)
The function uses Sodium to hash the message and compare it to the hashed value. If the hash is not a generic hash, the hash is treated as a phpass portable hash in order to provide backward compatibility for passwords and security keys which were hashed using phpass prior to WordPress 6.8.0.
Параметры
$message
string
обязательный
$hash
string
обязательный
Возвращаемое значение
bool
Исходный код
wp-includes/functions.php:9268
function wp_verify_fast_hash(
#[\SensitiveParameter]
string $message,
string $hash
): bool {
if ( ! str_starts_with( $hash, '$generic$' ) ) {
// Back-compat for old phpass hashes.
require_once ABSPATH . WPINC . '/class-phpass.php';
return ( new PasswordHash( 8, true ) )->CheckPassword( $message, $hash );
}
return hash_equals( $hash, wp_fast_hash( $message ) );
}
История изменений
| Версия | Описание |
|---|---|
| 6.8.0 | Introduced. |

