mirror of
https://github.com/dotnetcore/AgileConfig.git
synced 2026-10-21 14:51:55 +08:00
f3530881bd
2.Optimize MD5 performance
18 lines
461 B
C#
18 lines
461 B
C#
using System;
|
|
using System.Security.Cryptography;
|
|
using System.Text;
|
|
|
|
namespace AgileConfig.Server.Common
|
|
{
|
|
public static class Encrypt
|
|
{
|
|
private static readonly MD5 Md5Instance = MD5.Create();
|
|
public static string Md5(string txt)
|
|
{
|
|
var inputBytes = Encoding.ASCII.GetBytes(txt);
|
|
var hashBytes = Md5Instance.ComputeHash(inputBytes);
|
|
return Convert.ToHexString(hashBytes);
|
|
}
|
|
}
|
|
}
|