欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

md5 16位二进制与32位字符串相互转换示例_PHP教程

程序员文章站 2022-05-11 18:23:11
...
复制代码 代码如下:

$str = 'test';
$cm = md5($str);
$bm = md5($str, true);

$cstr = implode(unpack('H*', $bm));
$bstr = pack('H*', $cm);


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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/633591.htmlTechArticle复制代码 代码如下: ?php $str = 'test'; $cm = md5($str); $bm = md5($str, true); $cstr = implode(unpack('H*', $bm)); $bstr = pack('H*', $cm); echo 'str:'. $str . "br \n"; ech...