Encrypt.cs 411 B

1234567891011121314151617
  1. using System.Linq;
  2. using System.Security.Cryptography;
  3. using System.Text;
  4. namespace PartsWarehouse
  5. {
  6. public class Encrypt
  7. {
  8. public static string GetHash(string password)
  9. {
  10. using (var hash = SHA1.Create())
  11. {
  12. return string.Concat(hash.ComputeHash(Encoding.UTF8.GetBytes(password)).Select(x => x.ToString("X2")));
  13. }
  14. }
  15. }
  16. }