Home >Backend Development >PHP Tutorial >Example of conversion between md5 16-bit binary and 32-bit string_PHP tutorial

Example of conversion between md5 16-bit binary and 32-bit string_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:42:44985browse


Copy code The code is as follows:

$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.htmlTechArticleCopy the code as follows: ?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...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn