110,499
社区成员
发帖
与我相关
我的任务
分享
private byte[] stringToByteArray(string hexString)
{
hexString = hexString.Replace(" ", "");
if ((hexString.Length % 2) != 0)
hexString += " ";
byte[] returnBytes = new byte[hexString.Length / 2];
for (int i = 0; i < returnBytes.Length; i++)
returnBytes[i] = Convert.ToByte(hexString.Substring(i * 2, 2), 16);
return returnBytes;
}
public string Change(string strRes)
{
System.Security.Cryptography.MD5 md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
strRes = Convert.ToBase64String(md5.ComputeHash(System.Text.Encoding.Default.GetBytes(strRes)));
return strRes;
}
public static string Base64Decode(string ABase64)
{
return Encoding.Default.GetString(Convert.FromBase64String(ABase64));
}