求支付宝md5加密方法
请不要给我
static public string ByteArrayToHexString(byte[] buff)
{
StringBuilder sb = new StringBuilder(buff.Length);
for (int i = 0; i < buff.Length; i++)
{
sb.AppendFormat("{0:x2}", buff);
}
return sb.ToString();
}
public static string GetMD5(string key)
{
MD5 md5 = MD5.Create();
byte[] buffer= md5.ComputeHash(System.Text.Encoding.GetEncoding("GB2312").GetBytes(key));
return ByteArrayToHexString(buffer);
}
public static bool VerifyMD5(string key, string md5)
{
return GetMD5(key) == md5;
}
这个是错误的