MD5加密方法
/// <summary>
/// 16位MD5加密方法
/// </summary>
/// <param name="str">原文</param>
/// <returns>密文</returns>
public static string getMd5(string str)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string getstr = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(str)), 4, 8);
getstr = getstr.Replace("-", "");
return getstr;
}
/// 16位MD5加密方法
/// </summary>
/// <param name="str">原文</param>
/// <returns>密文</returns>
public static string getMd5(string str)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string getstr = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(str)), 4, 8);
getstr = getstr.Replace("-", "");
return getstr;
}
/// <summary>
/// 32位MD5加密方法
/// </summary>
/// <param name="str">原文</param>
/// <returns>密文</returns>
public static string getMd5(string str)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string getstr = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(str)));
getstr = getstr.Replace("-", "");
return getstr;
}
/// 32位MD5加密方法
/// </summary>
/// <param name="str">原文</param>
/// <returns>密文</returns>
public static string getMd5(string str)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
string getstr = BitConverter.ToString(md5.ComputeHash(UTF8Encoding.Default.GetBytes(str)));
getstr = getstr.Replace("-", "");
return getstr;
}