qing7777 / hash
Hyperf-ext hash 包
v1.0.0
2020-03-31 02:08 UTC
Requires
- php: >=7.2
- ext-swoole: >=4.4
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~4.1
This package is auto-updated.
Last update: 2024-09-09 01:34:50 UTC
README
使用composer安装此包
composer require qing7777/hash
配置
要使用自己的设置,请发布配置。
php bin/hyperf.php vendor:publish qing7260/hash
config/autoload/hash.php
获取Hash
use Qing7777\Hash\Hash; $str = '12345'; $encryptedStr = Hash::make($str);
或
use Hyperf\Utils\ApplicationContext; use Qing7777\Hash\HashInterface; $str = '12345'; $HashInterface = ApplicationContext::getContainer()->get(HashInterface::class); $HashInterface->make($str);
使用指定的Hash算法加密
use Qing7777\Hash\Hash; $str = '12345'; // Supported: "bcrypt", "argon" $encryptedStr = Hash::driver("argon")->make($str);