sign2 - 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 sign2.php

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