MD5Helper.cs 512 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Security.Cryptography;
  5. using System.Text;
  6. namespace Muchinfo.PC.Common.Helpers
  7. {
  8. public class MD5Helper
  9. {
  10. public static string Encrypt(string source)
  11. {
  12. byte[] result = Encoding.UTF8.GetBytes(source);
  13. MD5 md5 = new MD5CryptoServiceProvider();
  14. byte[] output = md5.ComputeHash(result);
  15. return BitConverter.ToString(output).Replace("-", "");
  16. }
  17. }
  18. }