You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
622 B

using System.Security.Cryptography;
using System.Text;
namespace APP.Utils
{
public class Utils
{
public static string GetMd5x2(string str)
{
MD5CryptoServiceProvider provider = new MD5CryptoServiceProvider();
byte[] bytes = Encoding.UTF8.GetBytes(str);
bytes = provider.ComputeHash(bytes);
StringBuilder builder = new StringBuilder();
foreach (byte num in bytes)
{
builder.Append(num.ToString("x2").ToLower());
}
return builder.ToString();
}
}
}