test crypt - 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 test crypt.php

  1. <?php
  2.  
  3. $param = round(microtime(true) * 1000);
  4. $param = base64_encode($param."xx");
  5. echo $param;
  6. echo "\r\n";
  7. $p = substr(uniqid(),-3);
  8. $q = substr(uniqid(),-1);
  9. echo "\r\n";
  10. $token = $p.$param.$q;
  11. echo $token;
  12. echo "\r\n";
  13. echo base64_decode($token);
  14. echo "\r\n";
  15.  
  16. $controllo = substr($token,3,-1);
  17. echo $controllo;
  18. echo "\r\n";
  19.  
  20. $controllo = substr(base64_decode($controllo),0,-2);
  21. echo $controllo;
  22. $ora = round(microtime(true) * 1000);
  23. $diff = $ora-$controllo;
  24. echo "\r\n";
  25. echo $diff;
File Description
  • test crypt
  • PHP Code
  • 20 Oct-2021
  • 488 Bytes
You can Share it: