lithium\util\StringDeprecated::compare()

public static method
Replaced by `lithium\security\Hash::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

boolean

Returns 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);
	}