3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //require_once('./blowfish.php'); //$myfile = fopen("serial.txt", "r") or die("Unable to open file!"); $data='14700902370|0006|Renato Tarabella|renato@tarabella.it|||||'; $iv = '00000000'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $encrypted=mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $data, MCRYPT_MODE_CBC, $iv); $hex=str2hex($encrypted); //fclose($myfile); echo $hex; function crypted($plainText){ $cipher = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_ECB, ''); $iv = 'FEDCBA9876543210'; // Show not be used anyway. $key = "0123456789ABCDEFF0E1D2C3B4A59687"; $cipherText = ""; if (mcrypt_generic_init($cipher, $key, $iv) != -1) { $cipherText = mcrypt_generic($cipher, $plainText); mcrypt_generic_deinit($cipher); } echo str2hex($cipherText); } function str2hex($func_string) { $func_retVal = ''; $func_length = strlen($func_string); for($func_index = 0; $func_index < $func_length; ++$func_index) $func_retVal .= ((($c = dechex(ord($func_string{$func_index}))) && strlen($c) & 2) ? $c : "0{$c}"); return strtoupper($func_retVal); } function String2Hex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex .= dechex(ord($string[$i])); } return $hex; } function Hex2String($hex){ $string=''; for ($i=0; $i < strlen($hex)-1; $i+=2){ $string .= chr(hexdec($hex[$i].$hex[$i+1])); } return $string; }
based on CHYuL
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/bVTEG:7 Stack trace: #0 {main} thrown in /in/bVTEG on line 7
Process exited with code 255.
Output for hhvm-3.15.4 - 3.17.3
7BC16EFC70D695BFDB2046B44F42B37A626EBD7AFE311D1C2296827FBB325F08A855ED49B82CB6B0C6287609E508CDD92E7EE096B51A49DF175B9C70BBDC6A21
Output for hhvm-3.12.14

Process exited with code 137.
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function mcrypt_encrypt() in /in/bVTEG on line 7
Process exited with code 255.