lithium\util\StringDeprecated::compare()
Compares two strings in constant time to prevent timing attacks.
Parameters
-
string
$known
The string of known length to compare against.
-
string
$user
The user-supplied string.
Returns
booleanReturns a boolean indicating whether the two strings are equal.
Source
public static function compare($known, $user) {
$message = "lithium\util\String::compare() has been deprecated in favor of ";
$message .= "lithium\security\Hash::compare().";
trigger_error($message, E_USER_DEPRECATED);
return Hash::compare($known, $user);
}