![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
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);
}