首页 WordPress函数大全 hash_equals()

hash_equals()

2020-05-02 / 3478阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

hash_equals( string $a, string $b )

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>

参数

$a

(string)
(Required)
Expected string.

$b

(string)
(Required)
Actual, user supplied, string.

返回

(bool) Whether strings are equal.

大家谈论
    我的见解