3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //Title of this code //php 5.5.12 $start = time(); $expire = time() + 2592000; $proto = 'http://'; $domain = 't2-btsport-live-hls-prod.akamaized.net'; $path = 'out/u/europe/europe.m3u8'; $key = 'A65A28D4A2F97F470624F15E637C205D'; $params = 'ip=2.31.243.204~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, pack("H*", "A65A28D4A2F97F470624F15E637C205D")); echo $proto.$domain.'/'.$path.'?hdnea='.$params.'~hmac='.$hash; ?>
based on 2OhHE
Output for 5.5.0 - 7.2.6
http://t2-btsport-live-hls-prod.akamaized.net/out/u/europe/europe.m3u8?hdnea=ip=2.31.243.204~st=1464160637~exp=1466752637~acl=/*~hmac=09db77ef7bab41bacd05e2aebf29ab133acf508ab5d9bbae048ea0edae9c909a