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.



Your result can be seen below.

Result of php executing





Full code of sign.php

  1. <?php
  2. $secretKey = 'e3db818579e56cd32731695af0f1173a138b16b0a7a1ab3886ea05284ed4324b4454a6c332409890';
  3. $timestamp = round(microtime(true) * 1000);
  4. $recvWindow = 5000;
  5. $payload = [
  6.     'method' => 'deposit-option'
  7.     ];
  8. $payload['timestamp'] = $timestamp;
  9. $payload['recvWindow'] = $recvWindow;
  10. $payloadString = json_encode($payload);
  11. $signature = hash_hmac('sha512', $payloadString, $secretKey);
  12. $payload['signature'] = $signature;
  13.  
  14. echo json_encode($payload, JSON_PRETTY_PRINT);
  15.  
  16. ?>
  17.  
  18.  
  19.  
File Description
  • sign
  • PHP Code
  • 02 Feb-2024
  • 486 Bytes
You can Share it: