using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace MD5Demo
{
class Program
{
static void Main(string[] args)
{
string str = "123";
//202cb962ac59075b964b07152d234b70
//202cb962ac59075b964b07152d234b70
Console.Write(UseMD5(str));
Console.ReadKey();
}
public static string UseMD5(string str)
{
MD5 md5 = MD5.Create();
byte[] buffer = Encoding.Default.GetBytes(str);
byte[] md5byte = md5.ComputeHash(buffer);
string strNew = "";
for (int i = 0; i < md5byte.Length; i++)
{
strNew += md5byte[i].ToString("x2");
}
return strNew;
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
namespace MD5Demo
{
class Program
{
static void Main(string[] args)
{
string str = "123";
//202cb962ac59075b964b07152d234b70
//202cb962ac59075b964b07152d234b70
Console.Write(UseMD5(str));
Console.ReadKey();
}
public static string UseMD5(string str)
{
MD5 md5 = MD5.Create();
byte[] buffer = Encoding.Default.GetBytes(str);
byte[] md5byte = md5.ComputeHash(buffer);
string strNew = "";
for (int i = 0; i < md5byte.Length; i++)
{
strNew += md5byte[i].ToString("x2");
}
return strNew;
}
}
}