Function

hash_equals

Synopsis

hash_equals(string, string): bool

Area
Runtime\PS\Crypto\Hash\hash_equalsareas

Description

hash_equals reports whether $known_string and $user_string are the same, in time that does not depend on how far along they first differ; strings of different lengths are never equal, and the comparison of a wrong-length guess is the one case that does leak, because the length check runs first.

Usage

$value = hash_equals($arguments);
$fn = hash_equals(...);

See also