PHP:如何生成字符串的HmacSHA256签名 [英] PHP: How can I generate a HmacSHA256 signature of a string
本文介绍了PHP:如何生成字符串的HmacSHA256签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有什么方法可以在php中创建字符串的HmacSHA256签名吗?
Is there any way to create a HmacSHA256 signature of a string in php?
推荐答案
使用 hash_hmac
:
$sig = hash_hmac('sha256', $string, $secret)
其中$secret
是您的密钥.
这篇关于PHP:如何生成字符串的HmacSHA256签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文