<?php
$post_parameters = array('type' => 'buy', 'amount' => 5.3);
$concatted_post_parameters = '';
$http_method = 'METHOD';
$uri = 'API';
$api_key = '789';
$nonce = 555;
$secret = '123';
ksort($post_parameters); // Sort parameters by key ascending
if (0 < count($post_parameters))
{
// Generate URL-encoded query string
$concatted_post_parameters = http_build_query($post_parameters, '', '&');
}
$hmac_data = implode('#', array($http_method, $uri, $api_key, $nonce, md5($concatted_post_parameters)));
$hmac = hash_hmac('sha256', $hmac_data, $secret);
print($hmac_data);
preferences:
16.36 ms | 402 KiB | 5 Q