laravel-hash-sm maintained by oh86
哈希-国密
一、安装
composer require oh86/laravel-hash-sm
# 安装和配置国密库
composer require oh86/sm_cryptor
php artisan vendor:publish --provider='Oh86\SmCryptor\SmCryptorServiceProvider'
二、配置 config/hashing.php
return [
'driver' => 'localHmacSm3', // localHmacSm3, telecomHmacSm3, unicomHmacSm3, gdmobileHmacSm3
];
三、使用示例
$en = Hash::driver('localHmacSm3')->make('123456');
/** @var bool */
$result = Hash::driver('localHmacSm3')->check('123456', $en);