{"id":277,"date":"2012-12-17T09:16:30","date_gmt":"2012-12-17T09:16:30","guid":{"rendered":"20f07591c6fcb220ffe637cda29bb3f6"},"modified":"2012-12-17T09:16:30","modified_gmt":"2012-12-17T09:16:30","slug":"","status":"publish","type":"post","link":"https:\/\/www.xiaobo.li\/notes\/archives\/277","title":{"rendered":"base62"},"content":{"rendered":"<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u65b0\u6d6a\u5fae\u535a\u7684mid\u5730\u5740\u8f6c\u6362\u6210\u77ed\u683c\u5f0f\u7f16\u7801\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\uff1a<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">221110410216147026<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u8f6c\u6362\u540e\uff1a<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">zF4mOFpN7A<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u6bd4\u5982\u65b0\u6d6a\u5fae\u535a\u5730\u5740\u53ef\u4ee5\u7ec4\u88c5\u6210\u8fd9\u6837\uff1a<a style=\"text-decoration:none;\" href=\"http:\/\/weibo.com\/1642634100\/5en0UftjV8H\" rel=\"nofollow\">http:\/\/weibo.com\/1642634100\/5en0UftjV8H<\/a>\uff0c\u5176\u4e2d\u6570\u5b57\u662f\u7528\u6237\u7684id\uff0c\u540e\u9762\u7684\u5b57\u7b26\u4e32\u662fbase62\u52a0\u5bc6\u540e\u7684mid\uff0c\u56e0\u6b64\u901a\u8fc7\u7ec4\u88c5\u8fd9\u4e24\u4e2a\uff0c\u53ef\u4ee5\u5f97\u5230\u4fe1\u606f\u7684\u4e3b\u4f53\u3002<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u672c\u6587\u7684\u4ee3\u7801\uff0c\u662f\u7531<a style=\"text-decoration:none;\" href=\"http:\/\/forum.open.weibo.com\/read.php?tid=3236&amp;uid=89934\" rel=\"nofollow\">http:\/\/forum.open.weibo.com\/read.php?tid=3236&amp;uid=89934<\/a>\u7684\u535a\u4e3b\u7684js\u4ee3\u7801\u6539\u6210php\u800c\u6765<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u8d34\u4e0b\u4ee3\u7801\uff0c\u8fd0\u884c\u548c\u535a\u4e3b\u7684\u4e00\u6837\uff0c\u8fd9\u91cc\u53ea\u662f\u5c06mid\u8f6c\u6210\u77ed\u683c\u5f0f\uff0c\u5176\u5b9e\u9006\u5411\u4e5f\u5f88\u597d\u6539\u4e86\uff1a<\/span><\/p>\n<p style=\"margin-top:0px;\">\n<p style=\"margin-top:0px;\">\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&lt;?php<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$str62keys = array(<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\",<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\",&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\",&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\",&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"z\",\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\",&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\",&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">);<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\/**<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* 10\u8fdb\u5236\u503c\u8f6c\u6362\u4e3a62\u8fdb\u5236<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* @param {String} int10 10\u8fdb\u5236\u503c<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* @return {String} 62\u8fdb\u5236\u503c<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;*\/<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">function int10to62($int10) {<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">global $str62keys;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$s62 = '';<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$r = 0;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">while ($int10 != 0)<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">{<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$r = $int10 % 62;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$s62 = $str62keys[$r].$s62;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$int10 = floor($int10 \/ 62);<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">}<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">return $s62;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">}<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\/**<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;*&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* \u901a\u8fc7mid\u83b7\u5f97\u77ed\u683c\u5f0f<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* @param string $mid<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;* @return \u77ed\u683c\u5f0f<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&nbsp;*\/<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">function getCodeByMid($mid){<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$url = '';<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">for ($i = strlen($mid) - 7; $i &gt; -7; $i -=7)<span style=\"line-height:22px;white-space:pre;\"> <\/span>\/\/\u4ece\u6700\u540e\u5f80\u524d\u4ee57\u5b57\u8282\u4e3a\u4e00\u7ec4\u8bfb\u53d6mid<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">{<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$offset1 = $i &lt; 0 ? 0 : $i;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$offset2 = $i + 7;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$num = substr($mid, $offset1,$offset2-$offset1);&nbsp;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;\"><span style=\"line-height:22px;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">\/\/mid.substring(offset1, offset2);<\/span><span style=\"line-height:22px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;white-space:pre;\"> <\/span><\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$num = int10to62($num);<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$url = $num .$url;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">}<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\">\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">return $url;<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">}<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">echo getCodeByMid('221110410216147026');<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">?&gt;<\/span><\/p>\n<p><span style=\"color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\"><br \/>\n<\/span><span style=\"color:#333333;\">&nbsp;\u4e3a\u4e86\u65b9\u4fbf\uff0c\u8fd9\u91cc\u628a\u90a3\u4f4d\u535a\u4e3b\u7684js\u4ee3\u7801\u4e5f\u8d34\u5728\u8fd9\u91cc\uff0c\u5927\u5bb6\u53ef\u4ee5\u505a\u4e00\u4e2a\u5bf9\u7167\uff1a<\/span> <\/p>\n<div><span style=\"color:#333333;\"><br \/>\n<\/span> <\/p>\n<div>\n<div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* \u65b0\u6d6a\u5fae\u535amid\u4e0eurl\u4e92\u8f6c\u5b9e\u7528\u5de5\u5177<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* \u4f5c\u8005: XiNGRZ (http:\/\/weibo.com\/xingrz)<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var WeiboUtility = {};<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* 62\u8fdb\u5236\u5b57\u5178<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">WeiboUtility.str62keys = [<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\",<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\",&nbsp;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\",&nbsp;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"u\", \"v\", \"w\", \"x\", \"y\", \"z\",<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\",&nbsp;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\",&nbsp;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\"<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">];<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* 62\u8fdb\u5236\u503c\u8f6c\u6362\u4e3a10\u8fdb\u5236<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @param {String} str62 62\u8fdb\u5236\u503c<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @return {String} 10\u8fdb\u5236\u503c<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">WeiboUtility.str62to10 = function(str62) {<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var i10 = 0;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">for (var i = 0; i &lt; str62.length; i++)<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var n = str62.length - i - 1;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var s = str62[i];<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">i10 += this.str62keys.indexOf(s) * Math.pow(62, n);<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">return i10;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">};<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* 10\u8fdb\u5236\u503c\u8f6c\u6362\u4e3a62\u8fdb\u5236<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @param {String} int10 10\u8fdb\u5236\u503c<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @return {String} 62\u8fdb\u5236\u503c<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">WeiboUtility.int10to62 = function(int10) {<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var s62 = '';<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var r = 0;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">while (int10 != 0)<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">r = int10 % 62;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">s62 = this.str62keys[r] + s62;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">int10 = Math.floor(int10 \/ 62);<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">return s62;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">};<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* URL\u5b57\u7b26\u8f6c\u6362\u4e3amid<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @param {String} url \u5fae\u535aURL\u5b57\u7b26\uff0c\u5982 \"wr4mOFqpbO\"<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @return {String} \u5fae\u535amid\uff0c\u5982 \"201110410216293360\"<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">WeiboUtility.url2mid = function(url) {<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var mid = '';<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">for (var i = url.length - 4; i &gt; -4; i = i - 4)<span style=\"line-height:22px;white-space:pre;\"> <\/span>\/\/\u4ece\u6700\u540e\u5f80\u524d\u4ee54\u5b57\u8282\u4e3a\u4e00\u7ec4\u8bfb\u53d6URL\u5b57\u7b26<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var offset1 = i &lt; 0 ? 0 : i;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var offset2 = i + 4;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var str = url.substring(offset1, offset2);<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">str = this.str62to10(str);<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">if (offset1 &gt; 0)<span style=\"line-height:22px;white-space:pre;\"> <\/span>\/\/\u82e5\u4e0d\u662f\u7b2c\u4e00\u7ec4\uff0c\u5219\u4e0d\u8db37\u4f4d\u88650<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">while (str.length &lt; 7)<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">str = '0' + str;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">mid = str + mid;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">return mid;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">};<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\"><br style=\"line-height:22px;\" \/><br \/>\n<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">\/**<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* mid\u8f6c\u6362\u4e3aURL\u5b57\u7b26<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @param {String} mid \u5fae\u535amid\uff0c\u5982 \"201110410216293360\"<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;* @return {String} \u5fae\u535aURL\u5b57\u7b26\uff0c\u5982 \"wr4mOFqpbO\"<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">&nbsp;*\/<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">WeiboUtility.mid2url = function(mid) {<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">if (typeof(mid) != 'string') return false;<span style=\"line-height:22px;white-space:pre;\"> <\/span>\/\/mid\u6570\u503c\u8f83\u5927\uff0c\u5fc5\u987b\u4e3a\u5b57\u7b26\u4e32\uff01<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var url = '';<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">for (var i = mid.length - 7; i &gt; -7; i = i - 7)<span style=\"line-height:22px;white-space:pre;\"> <\/span>\/\/\u4ece\u6700\u540e\u5f80\u524d\u4ee57\u5b57\u8282\u4e3a\u4e00\u7ec4\u8bfb\u53d6mid<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">{<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var offset1 = i &lt; 0 ? 0 : i;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var offset2 = i + 7;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">var num = mid.substring(offset1, offset2);<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">num = this.int10to62(num);<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">url = num + url;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">}<\/span><\/div>\n<div style=\"line-height:22px;\"><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">return url;<\/span><\/div>\n<div style=\"line-height:22px;\"><span style=\"line-height:22px;color:#333333;\">};<\/span> <\/p>\n<div style=\"display:none;\" class=\"clearfix\">\n<div style=\"display:none;\" class=\"ui-7308154584 noselect js-zfrg-6540\">&nbsp;<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"cite ztag fc03 phide\"><\/div>\n<p><script type=\"text\/javascript\">\nvar wumiiPermaLink = \"http:\/\/blog.163.com\/holyrain1314\/blog\/static\/10011413520129251170695\/\"; \/\/\u6587\u7ae0\u7684\u6c38\u4e45\u94fe\u63a5\uff0c\u4f5c\u4e3a\u6587\u7ae0\u7684\u552f\u4e00\u6807\u8bc6\nvar wumiiTags = \"\u65b0\u6d6a\u5fae\u535a\u7684mid,\u8f6cbase62\u683c\u5f0f\"; \/\/\u6587\u7ae0\u6807\u7b7e\uff0c\u4ee5\u82f1\u6587\u9017\u53f7\u5206\u9694\uff0c\u5982\uff1a\"\u6807\u7b7e1,\u6807\u7b7e2\"\nvar wumiiSitePrefix = \"http:\/\/blog.163.com\/holyrain1314\/\"; \/\/\u535a\u5ba2\u7684\u4e3b\u9875\u5730\u5740\uff0c\u4f5c\u4e3a\u535a\u5ba2\u7684\u552f\u4e00\u6807\u8bc6\nvar wumiiParams = \"&num=5&mode=3&pf=blog163\"; \/\/num\u4e3a\u9ed8\u8ba4\u663e\u793a\u7684\u76f8\u5173\u6587\u7ae0\u6570\u76ee\uff0cmode\u4e3a\u9ed8\u8ba4\u7684\u663e\u793a\u6a21\u5f0f\uff081\u4e3a\u6587\u5b57\uff0c2\u4e3a\u56fe\u7247\uff0c3\u4e3a\u81ea\u52a8\uff09\n<\/script><br \/>\n<script type=\"text\/javascript\" src=\"http:\/\/widget.wumii.com\/ext\/relatedItemsWidget.htm\"><\/script><\/p>\n<div class=\"l cl h100\">&nbsp;<\/div>\n","protected":false},"excerpt":{"rendered":"<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u65b0\u6d6a\u5fae\u535a\u7684mid\u5730\u5740\u8f6c\u6362\u6210\u77ed\u683c\u5f0f\u7f16\u7801\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\uff1a<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">221110410216147026<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u8f6c\u6362\u540e\uff1a<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">zF4mOFpN7A<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u6bd4\u5982\u65b0\u6d6a\u5fae\u535a\u5730\u5740\u53ef\u4ee5\u7ec4\u88c5\u6210\u8fd9\u6837\uff1a<a style=\"text-decoration:none;\" href=\"http:\/\/weibo.com\/1642634100\/5en0UftjV8H\" rel=\"nofollow\">http:\/\/weibo.com\/1642634100\/5en0UftjV8H<\/a>\uff0c\u5176\u4e2d\u6570\u5b57\u662f\u7528\u6237\u7684id\uff0c\u540e\u9762\u7684\u5b57\u7b26\u4e32\u662fbase62\u52a0\u5bc6\u540e\u7684mid\uff0c\u56e0\u6b64\u901a\u8fc7\u7ec4\u88c5\u8fd9\u4e24\u4e2a\uff0c\u53ef\u4ee5\u5f97\u5230\u4fe1\u606f\u7684\u4e3b\u4f53\u3002<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u672c\u6587\u7684\u4ee3\u7801\uff0c\u662f\u7531<a style=\"text-decoration:none;\" href=\"http:\/\/forum.open.weibo.com\/read.php?tid=3236&amp;uid=89934\" rel=\"nofollow\">http:\/\/forum.open.weibo.com\/read.php?tid=3236&amp;uid=89934<\/a>\u7684\u535a\u4e3b\u7684js\u4ee3\u7801\u6539\u6210php\u800c\u6765<\/span><\/p>\n<p style=\"margin-top:0px;font-family:Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif;\"><span style=\"color:#333333;\">\u8d34\u4e0b\u4ee3\u7801\uff0c\u8fd0\u884c\u548c\u535a\u4e3b\u7684\u4e00\u6837\uff0c\u8fd9\u91cc\u53ea\u662f\u5c06mid\u8f6c\u6210\u77ed\u683c\u5f0f\uff0c\u5176\u5b9e\u9006\u5411\u4e5f\u5f88\u597d\u6539\u4e86\uff1a<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">&lt;?php<\/span><\/p>\n<p style=\"line-height:22px;margin-top:0px;\"><span style=\"line-height:22px;color:#333333;font-family:'Arial, Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif';\">$str62k...<\/span><\/p>\n<p> <a href=\"https:\/\/www.xiaobo.li\/notes\/archives\/277\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[273],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-article"],"_links":{"self":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/comments?post=277"}],"version-history":[{"count":0,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xiaobo.li\/notes\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}