Automattic\WooCommerce\Internal\StockNotifications\Utilities

HasherHelper::wp_verify_fast_hashpublic staticWC 1.0

Verify a string.

Method of the class: HasherHelper{}

No Hooks.

Returns

true|false. Whether the string matches the hash.

Usage

$result = HasherHelper::wp_verify_fast_hash( $key, $hash ): bool;
$key(string) (required)
The string to verify.
$hash(string) (required)
The hash to verify.

HasherHelper::wp_verify_fast_hash() code WC 10.3.6

public static function wp_verify_fast_hash( string $key, string $hash ): bool {
	if ( function_exists( 'wp_verify_fast_hash' ) ) {
		return wp_verify_fast_hash( $key, $hash );
	}

	if ( ! str_starts_with( $hash, '$generic$' ) ) {
		return false;
	}

	return hash_equals( $hash, self::wp_fast_hash( $key ) );
}