还有关于你的程序,不知道是这个程序员有意为之还是弄错了,如果想要等到正确的MD5,应该是下面这样:public static string GetMD5(string str) { byte[] b = System.Text.Encoding.Default.GetBytes(str); b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b); string ret = ""; for (int i = 0; i < b.Length; i++) { ret = ret + b[i].ToString("x2"); } return ret; }
下面的循环操作,也只是转换成string
不应该是34位的纯数字,无法解释....
$tmp = md5($str);
$ret = '';
for($i = 0; $i < strlen($tmp); $i+=2){
$ret .= hexdec( $tmp[$i].$tmp[$i+1] );
}
return $ret;
}
{
byte[] b = System.Text.Encoding.Default.GetBytes(str);
b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b);
string ret = "";
for (int i = 0; i < b.Length; i++)
{
ret = ret + b[i].ToString("x2");
}
return ret;
}