3v4l.org

run code in 300+ PHP versions simultaneously
<?php $secret_key = sodium_hex2bin( '70637679b45ba313a122e63f12b3a557a01be9c0519fc8d08bb98f3633134e66' . '812540a01852c7e582021d253c1ecee35e948e294befe19ccf1cdbafa6266260' ); $public_key = sodium_hex2bin( '812540a01852c7e582021d253c1ecee35e948e294befe19ccf1cdbafa6266260' ); $message = 'Soatok is a gay/demi dhole furry <3'; $signature = sodium_crypto_sign_detached($message, $secret_key); var_dump(sodium_bin2hex($signature)); var_dump(sodium_crypto_sign_verify_detached($signature, $message, $public_key));
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.32, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
string(128) "ed5ffd42041982926937ea29076431372d05579215f00a77614b63eacf7ab517a7d8040dff9c7958775ede6511655f8a42358afd419b8289607d089df1a3cb02" bool(true)
Output for 7.4.33
Fatal error: Uncaught Error: Call to undefined function sodium_hex2bin() in /in/lKrJb:2 Stack trace: #0 {main} thrown in /in/lKrJb on line 2
Process exited with code 255.
Output for 5.6.0
Fatal error: Call to undefined function sodium_hex2bin() in /in/lKrJb on line 2
Process exited with code 255.

preferences:
73.49 ms | 408 KiB | 5 Q