- var_dump: documentation ( source)
- hex2bin: documentation ( source)
- bin2hex: documentation ( source)
<?php
$centesimas = 598322.3;
var_dump(intval($centesimas)== $centesimas);
$token = '9b81b2';
$key = 'CualquierCosa';
echo $descifrado = bin2hex(openssl_encrypt($token, "AES-128-ECB", $key, OPENSSL_RAW_DATA));
echo PHP_EOL;
echo openssl_error_string();
$tokenBD = '6f79ca09cf1267f02bd6e9179e112a2d';
$tokenCifrado = hex2bin($tokenBD);
$token = openssl_decrypt($tokenCifrado, "AES-128-ECB", $key, OPENSSL_RAW_DATA);
echo openssl_error_string();
echo $tokenBD.PHP_EOL;
echo $descifrado;
var_dump($tokenBD == $descifrado);