<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[用php5实现MD5加密取16位]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[代码编程]]></category>
<pubDate>Sat, 16 Dec 2006 01:23:41 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	php之md5加密2006-08-19 13:03php5之取16位md5值<br/><br/><br/>用php5实现<br/><br/>PHP代码:--------------------------------------------------------------------------------<br/><br/><div class="code"><br/><br/>&lt;?php<br/>/****<br/>php5 get md5 value<br/>****/<br/> <br/>$value = md5(&quot;just a test&quot;, true);<br/>echo $value;<br/> <br/>?&gt; <br/><br/></div><br/>--------------------------------------------------------------------------------<br/><br/>用php4实现(不能直接取16位的，要么自己写个，要么截取)<br/><br/>PHP代码:--------------------------------------------------------------------------------<br/><br/><div class="code"><br/><br/>&lt;?php<br/>/****<br/>php4 get md5 value<br/>****/<br/> <br/>$value = hex2bin(md5(&quot;just a test&quot;));<br/>echo $value;<br/> <br/>/*<br/>+--------------------------------------------------<br/>&#124; &nbsp; 函数名: hex2bin($data)<br/>&#124; &nbsp; 作用: 将16进转换为2进<br/>&#124; &nbsp; 参数: $data<br/>&#124; &nbsp; &nbsp;<br/>&#124;<br/>&#124; &nbsp; 返回值: 二进bit流<br/>+--------------------------------------------------<br/>*/<br/>function hex2bin($data) <br/>&#123;<br/> &nbsp; &nbsp;$len = strlen($data);<br/> &nbsp; &nbsp;$newdata = &#039;&#039;;<br/> <br/> &nbsp; &nbsp;for($i=0;$i&lt;$len;$i+=2) <br/> &nbsp; &nbsp;&#123;<br/> &nbsp; &nbsp; &nbsp; &nbsp;$newdata .= pack(&quot;C&quot;,hexdec(substr($data,$i,2)));<br/> &nbsp; &nbsp;&#125;<br/> <br/> &nbsp; &nbsp;return $newdata;<br/>&#125;<br/><br/> </div><br/><br/>Tags - <a href="http://www.dzhope.com/tags/md5%25E5%258A%25A0%25E5%25AF%2586/" rel="tag">md5加密</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] 用php5实现MD5加密取16位]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>