$chars=array("a","b","c","d","e","f","g","h",
"i","j","k","l","m","n","o","p",
"q","r","s","t","u","v","w","x",
"y","z","0","1","2","3","4","5",
"6","7","8","9","A","B","C","D",
"E","F","G","H","I","J","K","L",
"M","N","O","P","Q","R","S","T",
"U","V","W","X","Y","Z");
$salt="www.joneto.com";
$hash=md5("http://www.sina.com".$salt);
$rs=array();
for($i=0;$i<4;$i++){
$temp=substr($hash, $i*8,8);
$temp=base_convert($temp, 16, 2) & base_convert("3fffffff", 16, 2);
$str="";
for($j=0;$j<6;$j++){
$subtemp=base_convert((substr($temp, $j*5,5) & base_convert("3d", 16, 2)),2,10);
$str.=$chars[$subtemp];
}
$rs[]=$str;
}
print_r($rs);
生成短地址
最新推荐文章于 2024-06-05 14:01:47 发布