2020-05-02 / 3837阅 / 悠然
Timing attack safe string comparison
Compares two strings using the same time whether they’re equal or not.
Note: It can leak the length of a string when arguments of differing length are supplied.
This function was added in PHP 5.6. However, the Hash extension may be explicitly disabled>
(string)
(Required)
Expected string.
(string)
(Required)
Actual, user supplied, string.
(bool) Whether strings are equal.