推荐:《PHP视频教程》
php国密SM3签名算法
github.com/lizhichao/sm
composer require lizhichao/one-sm
require __DIR__ . '/vendor/autoload.php'; // 字符串签名 echo \OneSm\Sm3::sign('abc') . PHP_EOL; echo \OneSm\Sm3::sign(str_repeat("adfas哈哈哈", 100)) . PHP_EOL; // 文件签名 echo \OneSm\Sm3::signFile(__FILE__) . PHP_EOL;
php bench.php
结果
openssl:7ad7adf191f10aeeb0b2c02e083d03c4c675351022b267722c4cc6589c7836e9 one-sm3:7ad7adf191f10aeeb0b2c02e083d03c4c675351022b267722c4cc6589c7836e9SM3-PHP:b7a0c84f86acd90f41f09d791735baf07ddf8acae6349319f5ab71c375fa37cb openssl time:4.755973815918ms one-sm3 time:5.5310726165771msSM3-PHP time:708.27698707581ms
测试代码bench.php:
https://github.com/lizhichao/sm/blob/master/bench.php
以上是关于php国密SM3签名算法的详细内容。更多信息请关注PHP中文网其他相关文章!