Skip to content

Commit

Permalink
Merge pull request #140 from InCerryGit/ls_opt
Browse files Browse the repository at this point in the history
Optimize MD5 performance
  • Loading branch information
kklldog committed Jul 6, 2023
2 parents d71ce23 + f353088 commit 1935079
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
17 changes: 17 additions & 0 deletions AgileConfig.Server.Common/Encrypt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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);
}
}
}
27 changes: 0 additions & 27 deletions AgileConfig.Server.Common/encrypt.cs

This file was deleted.

0 comments on commit 1935079

Please sign in to comment.