Advertisement
MadCortez

Untitled

Jun 27th, 2023
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System.Security.Cryptography;
  2. using System.Text;
  3.  
  4. namespace MyCloud.Helpers
  5. {
  6.     public static class HashPasswordHelper
  7.     {
  8.         public static string HashPassowrd(string password)
  9.         {
  10.             using (var sha256 = SHA256.Create())
  11.             {
  12.                 var hashedBytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(password));
  13.                 var hash = BitConverter.ToString(hashedBytes).Replace("-", "").ToLower();
  14.  
  15.                 return hash;
  16.             }
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement