PHP code example of lijinhua / tp-hash

1. Go to this page and download the library: Download lijinhua/tp-hash 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/ */

    

lijinhua / tp-hash example snippets


use lijinhua\hash\facade\Hash;

$password = 'admin123';
// 密码加密
$passwordHash =  Hash::create($password);
// dump($passwordHash);

// 密码验证
if (Hash::check($password,$passwordHash)) {
    echo 'true';
}else{
    echo 'false';
}
shell
$ php think hash:config