12345678910111213141516171819202122 |
- using System.Text;
- namespace XGame.Framework.Utils
- {
- /// <summary>
- /// 安全性工具类
- /// </summary>
- public static partial class SecurityUtils
- {
- public static string MD5(string input)
- {
- var output = MD5(Encoding.UTF8.GetBytes(input));
- return output.ToHexString();
- }
- public static byte[] MD5(byte[] input)
- {
- var md5 = System.Security.Cryptography.MD5.Create();
- return md5.ComputeHash(input);
- }
- }
- }
|