- hash_hmac: documentation ( source)
- json_encode: documentation ( source)
<?php
$commands['api_key'] = '789';
$commands['nonce'] = 555;
$message = json_encode($commands);
print($message);
$signature = hash_hmac('sha256', $message, '123');
print($signature);