qing7777/hash

Hyperf-ext hash 包

安装: 42

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:package

v1.0.0 2020-03-31 02:08 UTC

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);