PHP code example of arthens / request-signer
1. Go to this page and download the library: Download arthens/request-signer library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arthens / request-signer example snippets
// Use composer or import the class manually
ns\RequestSigner\Signer('here-your-secret-key');
// Generate a new url-friendly signature
$signature = $signer->sign('GET', '/news');
// Verify a signature
if (!$signer->verify('here-the-signature-from-request', 'GET', '/news')) {
throw new \Exception('Invalid signature');
}