//对 A 密码使用Bcrypt 加密 2 $password = Hash::make('secret'); 3 4 //你也可直接使用 bcrypt 的 function 5 $password = bcrypt('secret'); 6 7 //对加密的 A 密码进行验证 8 if (Hash::check('secret', $hashedPassword)) 9 { 10 // The passwords match... 11 } 12 //检查 A 密码是否需要重新加密 13 if (Hash::needsRehash($hashed)) 14 { 15 $hashed = Hash::make('secret');16 }
参考文章:
http://www.cnblogs.com/xxxxxxx/p/5381673.html
https://docs.golaravel.com/docs/5.0/hashing/
http://blog.csdn.net/left_la/article/details/38109485
laravel中bcrypt和encrypt的区别
最新推荐文章于 2024-07-11 17:26:41 发布