user1339316
user1339316

Reputation: 75

REST API Authentication in PHP - How to generate a signature

First, I'm pretty new to APIs, so I'm struggling to keep my head above water here... but either way, I need to generate a HMAC-SHA signature in PHP. How would I do so?

Upvotes: 0

Views: 778

Answers (1)

Drew
Drew

Reputation: 24949

<?php
echo "welcome<br />";
echo "welcome<br />";
echo hash_hmac('sha256', 'This is only a test sentence of gibberish.', 'secret123');
echo "<br />";
?>

Upvotes: 1

Related Questions