3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $start = time(); $expire = time() + 2592000; $proto = 'http://'; $domain = 't2-btsport-live-hls-prod.akamaized.net'; $path = 'out/u/bts1/642_6.m3u8'; $key = '0326ebdb3e654166a66d3c62'; //$params = 'ip=1.2.3.4~st='.$start.'~exp='.$expire.'~acl=/*'; //WITH IP $params = 'st='.$start.'~exp='.$expire.'~acl=/*'; //NO IP function h2b($str) { $bin = ""; $i = 0; do { $bin .= chr(hexdec($str{$i}.$str{($i + 1)})); $i += 2; } while ($i < strlen($str)); return $bin; } $hash = hash_hmac('SHA256', $params, h2b($key)); echo $proto.$domain.'/'.$path.'?hdnea='.$params.'~hmac='.$hash; ?>
Output for 5.5.0 - 7.3.0beta1
http://t2-btsport-live-hls-prod.akamaized.net/out/u/bts1/642_6.m3u8?hdnea=st=1459368084~exp=1461960084~acl=/*~hmac=fe5104bd2f225bd2c7f4eaaf9f332de967f4c886da7f40ac931d3dca2bdbcc42