3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function calculate_signature($string, $private_key) { $hash = hash_hmac("sha1", $string, $private_key, true); $sig = rawurlencode(base64_encode($hash)); return $sig; } $api_key = "1234"; $private_key = "abcd"; $method = "GET"; $route = "forms/1/entries"; $expires = strtotime("7:00"); $string_to_sign = sprintf("%s:%s:%s:%s", $api_key, $method, $route, $expires); $sig = calculate_signature($string_to_sign, $private_key); var_dump($sig); var_dump(strtotime("7:00")); ?>
based on GUGBT
Output for 5.3.19 - 7.3.0
string(30) "64SdpxjsutiBmvE4MiiKmfqla1o%3D" int(1445925600)