PHP code example of j3j5 / hmac-bcrypt-laravel

1. Go to this page and download the library: Download j3j5/hmac-bcrypt-laravel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

j3j5 / hmac-bcrypt-laravel example snippets


'hmac-bcrypt' => [
    'pepper' => 'black-pepper'
],

'hmac-bcrypt' => [
    'rounds' => 15
],

$clearTextPass = 'supersecret';

$hash = Hash::make($clearTextPass);

// Now store it on the db

if (Hash::check($clearTextPass, $hash)) {
    // eccoli qua! you can log in your user!

    // Check whether your settings have changed since last time
    if (Hash::needsRehash($hash)) {
        $newHash = Hash::make($clearTextPass);
        // Store the new hash on the db
    }
}