How can I generate a HmacSHA256 signature of a string

Use hash_hmac:

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

Where $secret is your key.

Leave a Comment