- var_dump: documentation ( source)
- hash_hmac: documentation ( source)
- strtotime: documentation ( source)
<?php
$file_id = 1;
$project_id = 1;
$token = $project_id;
$expiry = strtotime('+1 years');
$signature = hash_hmac('sha256', "{$file_id}-{$token}-{$expiry}", "shared-secret");
$url = "https://media.example.com/?file_id={$file_id}&token={$token}&expiry={$expiry}&signature={$signature}";
var_dump($file_id, $token, $expiry, $signature, $url);