基本用法

2018-02-24 15:52 更新

對 A 密碼使用Bcrypt 加密

$password = Hash::make('secret');

你也可直接使用 bcrypt 的 function

$password = bcrypt('secret');

對加密的 A 密碼進行驗證

if (Hash::check('secret', $hashedPassword))
{
    // The passwords match...
}

檢查 A 密碼是否需要重新加密

if (Hash::needsRehash($hashed))
{
    $hashed = Hash::make('secret');
}
以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號