PHP: How can I generate a HmacSHA256 signature of a string

前端 未结 4 1535
误落风尘
误落风尘 2020-12-08 06:18

Is there any way to create a HmacSHA256 signature of a string in php?

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-08 06:52

    Use hash_hmac:

    $sig = hash_hmac('sha256', $string, $secret)
    

    Where $secret is your key.

提交回复
热议问题