php hmac-sha1加密算法示例
php hmac-sha1加密算法示例 [代码片段(10行)]
<?php $key = "0f2100e34b54d50fd0138f300d3497579dae5279"; $data = "secret-message"; $decodedKey = pack("H*", $key); $hmac = hash_hmac("sha1", $data, $decodedKey, TRUE); $signature = base64_encode($hmac); echo "key = $key\n"; echo "data = $data\n"; echo "signature = $signature"; ?>
- 上一篇:PHP中构造函数和析构函数解析
- 下一篇:php Mysql事务处理(一个转账程序)
精彩图集
精彩文章