Require this package with composer:
composer require qing7777/hash
To use your own settings, publish config.
php bin/hyperf.php vendor:publish qing7260/hash
config/autoload/hash.php
use Qing7777\Hash\Hash;
$str = '12345';
$encryptedStr = Hash::make($str);
or
use Hyperf\Utils\ApplicationContext;
use Qing7777\Hash\HashInterface;
$str = '12345';
$HashInterface = ApplicationContext::getContainer()->get(HashInterface::class);
$HashInterface->make($str);
use Qing7777\Hash\Hash;
$str = '12345';
// Supported: "bcrypt", "argon"
$encryptedStr = Hash::driver("argon")->make($str);