using System;
using System.Text;
using System.Security.Cryptography;
namespace MD5_MethodTest
{
class MD5Encode
{
private string Encode(string InitString)
{
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] btSerialCode;
btSerialCode = md5.ComputeHash(System.Text.Encoding.Default.GetBytes(InitString));
string EncryptedString =BitConverter.ToString(btSerialCode).Replace("-", "");
return EncryptedString;
}
}
}
using System;
using System.Text;
using System.Security.Cryptography;
namespace Suzsoft.MMS.Common
{
public class Md5Encode
{
public static string Encode(string strOriginal)
{
MD5CryptoServiceProvider objMD5 = new MD5CryptoServiceProvider();
byte[] byteInput = UTF8Encoding.UTF8.GetBytes(strOriginal);
byte[] byteOutput = objMD5.ComputeHash(byteInput);
return BitConverter.ToString(byteOutput).Replace("-","");
}
}
}