Encrypt.cs 481 B

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