t3 signature calculator - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of t3 signature calculator.php
- <?php
- function sortRecursiveByKeys($array)
- {
- foreach ($array as &$value) {
- if (is_array($value)) {
- $value = sortRecursiveByKeys($value);
- }
- }
- ksort($array);
- return $array;
- }
- function preparePWParams($params = array())
- {
- return urldecode(http_build_query($params, null, ''));
- }
- function createPWSignature($input, string $secret)
- {
- $input = parse_url($input);
- parse_str($input['query'], $input);
- unset($input['sig']);
- $input = sortRecursiveByKeys($input);
- $baseString = preparePWParams($input);
- return hash_hmac('sha256', $baseString, $secret);
- }
- echo createPWSignature(
- 'http://demo.terminal3.com/pricepoint?uid=14236346',
- 'dsgsdgsdgsg'
- );
File Description
- t3 signature calculator
- PHP Code
- 11 Sep-2019
- 862 Bytes
You can Share it:
Latest PHP Pastes