hash_equals 可防止时序攻击的字符串比较?
hash_equals 函数 — 可防止时序攻击的字符串比较
这是什么攻击
if (!hash_equals($verifyData['code'], $request->verification_code)) {
// 返回401
return $this->response->errorUnauthorized('验证码错误');
}
推荐文章: