<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP: Short URL Algorithm Implementation</title>
	<atom:link href="http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/</link>
	<description>IT News, Programming, Internet and Blogging</description>
	<lastBuildDate>Thu, 13 May 2010 02:36:59 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Short Url（短网址）实现方式 &#124; I@laoer.com</title>
		<link>http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/comment-page-1/#comment-124</link>
		<dc:creator>Short Url（短网址）实现方式 &#124; I@laoer.com</dc:creator>
		<pubDate>Mon, 27 Apr 2009 06:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.snippetit.com/?p=83#comment-124</guid>
		<description>[...] 另一个算法来自http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 function shorturl&#40;$input&#41; &#123; $base32 = array &#40; &#039;a&#039;, &#039;b&#039;, &#039;c&#039;, &#039;d&#039;, &#039;e&#039;, &#039;f&#039;, &#039;g&#039;, &#039;h&#039;, &#039;i&#039;, &#039;j&#039;, &#039;k&#039;, &#039;l&#039;, &#039;m&#039;, &#039;n&#039;, &#039;o&#039;, &#039;p&#039;, &#039;q&#039;, &#039;r&#039;, &#039;s&#039;, &#039;t&#039;, &#039;u&#039;, &#039;v&#039;, &#039;w&#039;, &#039;x&#039;, &#039;y&#039;, &#039;z&#039;, &#039;0&#039;, &#039;1&#039;, &#039;2&#039;, &#039;3&#039;, &#039;4&#039;, &#039;5&#039; &#41;; &#160; $hex = md5&#40;$input&#41;; $hexLen = strlen&#40;$hex&#41;; $subHexLen = $hexLen / 8; $output = array&#40;&#41;; &#160; for &#40;$i = 0; $i &lt; $subHexLen; $i++&#41; &#123; $subHex = substr &#40;$hex, $i * 8, 8&#41;; $int = 0x3FFFFFFF &amp; &#40;1 * &#40;&#039;0x&#039;.$subHex&#41;&#41;; $out = &#039;&#039;; &#160; for &#40;$j = 0; $j &lt; 6; $j++&#41; &#123; $val = 0x0000001F &amp; $int; $out .= $base32&#91;$val&#93;; $int = $int &gt;&gt; 5; &#125; &#160; $output&#91;&#93; = $out; &#125; &#160; return $output; &#125; [...]</description>
		<content:encoded><![CDATA[<p>[...] 另一个算法来自http://www.snippetit.com/2009/04/php-short-url-algorithm-implementation/ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 function shorturl&#40;$input&#41; &#123; $base32 = array &#40; &#8216;a&#8217;, &#8216;b&#8217;, &#8216;c&#8217;, &#8216;d&#8217;, &#8216;e&#8217;, &#8216;f&#8217;, &#8216;g&#8217;, &#8216;h&#8217;, &#8216;i&#8217;, &#8216;j&#8217;, &#8216;k&#8217;, &#8216;l&#8217;, &#8216;m&#8217;, &#8216;n&#8217;, &#8216;o&#8217;, &#8216;p&#8217;, &#8216;q&#8217;, &#8216;r&#8217;, &#8217;s&#8217;, &#8216;t&#8217;, &#8216;u&#8217;, &#8216;v&#8217;, &#8216;w&#8217;, &#8216;x&#8217;, &#8216;y&#8217;, &#8216;z&#8217;, &#8216;0&#8242;, &#8216;1&#8242;, &#8216;2&#8242;, &#8216;3&#8242;, &#8216;4&#8242;, &#8216;5&#8242; &#41;; &nbsp; $hex = md5&#40;$input&#41;; $hexLen = strlen&#40;$hex&#41;; $subHexLen = $hexLen / 8; $output = array&#40;&#41;; &nbsp; for &#40;$i = 0; $i &lt; $subHexLen; $i++&#41; &#123; $subHex = substr &#40;$hex, $i * 8, 8&#41;; $int = 0&#215;3FFFFFFF &amp; &#40;1 * &#40;&#8217;0x&#8217;.$subHex&#41;&#41;; $out = &#8221;; &nbsp; for &#40;$j = 0; $j &lt; 6; $j++&#41; &#123; $val = 0&#215;0000001F &amp; $int; $out .= $base32&#91;$val&#93;; $int = $int &gt;&gt; 5; &#125; &nbsp; $output&#91;&#93; = $out; &#125; &nbsp; return $output; &#125; [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
