md5 example of converting 16 bit binary to 32 bit strings

  • 2020-12-09 00:45:33
  • OfStack



<?php
$str = 'test';
$cm = md5($str);
$bm = md5($str, true);
$cstr = implode(unpack('H*', $bm));
$bstr = pack('H*', $cm);

echo 'str:'. $str . "<br >\n";
echo 'cm :' . $cm . "<br >\n";
echo 'cstr:' . $cstr . "<br >\n";
echo 'urlencode(bm)  :' . urlencode($bm) . "<br >\n";
echo 'urlencode(bstr):' . urlencode($bstr) . "<br >\n";


Related articles: