using System;
using System.Security.Cryptography;
using System.Text;
namespace Sshz.Imix.Platform.Web
{
public static class MD5Utility
{
public static string Encrypt(this string s)
{
byte[] hash;
byte[] inputPasswordBytes=System.Text.UnicodeEncoding.Unicode.GetBytes(s);
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
hash = md5.ComputeHash(inputPasswordBytes);
StringBuilder sb = new StringBuilder();
foreach (byte b in hash)
{
sb.Append(b.ToString("x2").ToUpper());
}
return sb.ToString();
}
}
}