MD5 encryption(Hash Algorithm)
代码
public static string Encrypt(string data)
{
HashAlgorithm hash = new MD5CryptoServiceProvider();
byte[] encrypted = hash.ComputeHash(Encoding.ASCII.GetBytes(data));
return Convert.ToBase64String(encrypted);
}
{
HashAlgorithm hash = new MD5CryptoServiceProvider();
byte[] encrypted = hash.ComputeHash(Encoding.ASCII.GetBytes(data));
return Convert.ToBase64String(encrypted);
}