public static string Base64Decode(string str)
{
byte[] bytes = Convert.FromBase64String(str);
bytes = Convert.FromBase64String(Encoding.Default.GetString(bytes));
return Encoding.Default.GetString(bytes);
}
public static string Base64Encode(string str)
{
string go = Convert.ToBase64String(Encoding.Default.GetBytes(str));
return Convert.ToBase64String(Encoding.Default.GetBytes(go));
}
public string Md5Sum(string value)
{
System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create();
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(value);
byte[] hash = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hash.Length; i++)
{
sb.Append(hash[i].ToString("X2"));
}
return sb.ToString();
}
unity3d的base64和MD5
最新推荐文章于 2024-08-11 11:48:03 发布