- hash_hmac: documentation ( source)
- var_export: documentation ( source)
- sprintf: documentation ( source)
<?php
$hmac = hash_hmac("sha1", 'abcdefg', '#0123455');
$token = sprintf("%1.1s%20.20s", '0', $hmac);
var_export([
$hmac,
$token,
sprintf("%1.1s%20.20s", '0', 'abc')
]);