I didn't work with ruby ever, only with php. And I need help.
I have ruby code which encode string like that:
str = '123';
arr = str.bytes
p Digest::MD5.base64digest(arr.pack('C*')) # ICy5YqxZB1uWSwcVLSNLcA==
I need to do the same in php, and get the the same result. My example
$str = '123';
$bytes = unpack('C*', $str);
$pack = pack('C*', implode(', ', $bytes));
echo base64_encode(md5($pack)); // YzRjYTQyMzhhMGI5MjM4MjBkY2M1MDlhNmY3NTg0OWI=
Why the results are different. Thanks for help.