sign - 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 sign.php
- <?php
- $secretKey = 'e3db818579e56cd32731695af0f1173a138b16b0a7a1ab3886ea05284ed4324b4454a6c332409890';
- $timestamp = round(microtime(true) * 1000);
- $recvWindow = 5000;
- $payload = [
- 'method' => 'deposit-option'
- ];
- $payload['timestamp'] = $timestamp;
- $payload['recvWindow'] = $recvWindow;
- $payloadString = json_encode($payload);
- $signature = hash_hmac('sha512', $payloadString, $secretKey);
- $payload['signature'] = $signature;
- echo json_encode($payload, JSON_PRETTY_PRINT);
- ?>