我正在使用 Lumen 开发我的 API 网站,我遇到了这部分,我在其中散列密码并检查散列,但它总是返回false
下面是我的尝试。
$hashed = $request->input('hash'); // e.g. $2y$10$EBQKLl5cdbOLzP0luWUlp.hQYJLYGnDeOymodXSAbWj.Posf.yv1m
$res = Hash::check(trim($request->input('password')), trim($hashed));
return response()->json([ 'hash' => $hashed, 'password' => $request->input('password')), 'hash_result' => $res ]);
我使用修剪来确保没有空格,并且我可以验证变量(哈希、密码)是否存在,所以看起来有什么问题?
使用邮递员
非常感谢任何帮助和想法。谢谢你。