Hello,
Does anyone know how PHP's bin2hex command works? I found a code to reverse it (hex2bin shown below), now I'm just hoping there is a similar code for bin2hex
:
function hex2bin($hexdata) {
for ($i=0;$i<strlen($hexdata);$i+=2) {
$bindata.=chr(hexdec(substr($hexdata,$i,2)));
}
return $bindata;
}
I need to find the source of PHP's bin2hex so I can translate it into JavaScript. JS's capabilities only allow me to bin2hex numbers whilst PHP's let's me bin2hex just about anything, even the raw source of a .EXE application.
I'm trying to preserve a variable (the source of a .EXE application) and get it from JavaScript into PHP and I think this is the only way considering every other way I tried lost a lot of the special characters. If you can think of another way, please let me know.
Thanks for any help in advance.
Does anyone know how PHP's bin2hex command works? I found a code to reverse it (hex2bin shown below), now I'm just hoping there is a similar code for bin2hex

function hex2bin($hexdata) {
for ($i=0;$i<strlen($hexdata);$i+=2) {
$bindata.=chr(hexdec(substr($hexdata,$i,2)));
}
return $bindata;
}
I need to find the source of PHP's bin2hex so I can translate it into JavaScript. JS's capabilities only allow me to bin2hex numbers whilst PHP's let's me bin2hex just about anything, even the raw source of a .EXE application.
I'm trying to preserve a variable (the source of a .EXE application) and get it from JavaScript into PHP and I think this is the only way considering every other way I tried lost a lot of the special characters. If you can think of another way, please let me know.
Thanks for any help in advance.
Comment