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); ?>
based on ukRh4
Output for 5.3.19 - 5.4.45, 5.6.28, 7.0.20 - 7.2.0
string(30) "64SdpxjsutiBmvE4MiiKmfqla1o%3D"
Output for 7.0.6
string(30) "Wk3I8xG2zyaOZO2mGLXulVU2yP0%3D"
Output for 7.0.5
string(30) "x5DDKGvWjtISlisJTNxkaA1GzQc%3D"
Output for 7.0.4
string(32) "4R03kzR62z9JxqTrZn%2B3WtRkPIU%3D"
Output for 7.0.3
string(30) "3vGeVzpuBwNujoca9AGAaK0mmPY%3D"
Output for 7.0.2
string(30) "b1fzNW33S95wvcDGNSTFxx1zFj4%3D"
Output for 7.0.1
string(32) "TiO0GGx%2FhKMWmrj6NwnYRwQrLUA%3D"
Output for 7.0.0
string(30) "Shwkd9PQqqUEZ2ghTpSic9uEoG4%3D"
Output for 5.6.21
string(30) "6ZJJ9eIluaTqdIwFTfStWVASzAM%3D"
Output for 5.6.20
string(32) "znVhCjjglm19E1a8WAGz%2FGg0Exs%3D"
Output for 5.6.19
string(32) "mAfbiKjMrhHUli%2BBFAb43mYdrv4%3D"
Output for 5.6.18
string(30) "YHDHFW8Did7JVy3DCApF9xw0ogc%3D"
Output for 5.6.17
string(36) "j%2F4BPWzoNorOsNwOgG8ccu%2BDg%2BU%3D"
Output for 5.6.16
string(30) "kAhBP16cTmYpIg5uP2W2uI6OAqY%3D"
Output for 5.6.15
string(32) "l7rB%2FkPB7v53AErb5URFyAXNY0w%3D"
Output for 5.6.14
string(30) "gKXG5GNL9Y7FbRxXdqT0RLoBpMk%3D"
Output for 5.6.13
string(32) "dM%2BKoCMnTnLB1WaHIajrTEF0raM%3D"
Output for 5.6.12
string(30) "Qb6kUcLDF0OvxFh5o6Eeb1ZOpDk%3D"
Output for 5.6.11
string(36) "xkWdGeX%2F%2BB3sE%2Fg9q3jBoq7ihtM%3D"
Output for 5.6.10
string(32) "jImogT6YJQShqN%2FAeL697mPnsV0%3D"
Output for 5.6.9
string(30) "Rwnoan7cxGMGnsM7Iy8Qq6SHR4Q%3D"
Output for 5.6.8
string(30) "0kTZppkvuP81JaZ2JxhjIbq9MYM%3D"
Output for 5.5.35
string(32) "4KnYevSN1AVsm%2Bqe813IhVSbckk%3D"
Output for 5.5.34
string(30) "tPHdlrmvqn0bW3Y4TVt0IsguzMc%3D"
Output for 5.5.33
string(30) "NuEsUruGv9QJeLgogq75sFEBEbM%3D"
Output for 5.5.32
string(34) "5pM8xseZwNs8%2BlEtHO%2F3m292II8%3D"
Output for 5.5.31
string(32) "eZZwsTj%2B3iRiTRmhS0cgXPFQmVk%3D"
Output for 5.5.30
string(30) "6NUj6Pfq4BgVjwAYgXWOlyxlMrI%3D"
Output for 5.5.29
string(32) "53YH9Rs%2FLJgnt53b7tnNDYqZrGo%3D"
Output for 5.5.28
string(30) "6C6iUeDkeIixUIeaqRNpy43KqMk%3D"
Output for 5.5.27
string(32) "4XuWTWnrjLP8hFb%2B1sG0ugnAxek%3D"
Output for 5.5.26
string(30) "5Ix9h9yVOy4L8dsE5wjLI0phQcM%3D"
Output for 5.5.25
string(34) "GhWMezHyX58JNecYCr1%2FdRRn%2FDY%3D"
Output for 5.5.24
string(30) "mu3jKjQAkfc0891DJROocxbSf8Q%3D"