Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

encrypt password easiest way in web app .net

public static string HashPassword(string password, string algorithm = "sha256")
{
   return Hash(Encoding.UTF8.GetBytes(password), algorithm);
}

private static string Hash(byte[] input, string algorithm = "sha256")
{
    using (var hashAlgorithm = HashAlgorithm.Create(algorithm))
    {
        return Convert.ToBase64String(hashAlgorithm.ComputeHash(input));
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# http post request with file 
Csharp :: sort array dotnet 
Csharp :: c# on variable change property get set 
Csharp :: unity stop physics 
Csharp :: c# tell if a class is a child or the class itself 
Csharp :: c# asp.net hover tooltip 
Csharp :: c# signalr console app server example 
Csharp :: serial begin 
Csharp :: c# networkstream read all bytes 
Csharp :: last index for array c# 
Csharp :: dapper get list 
Csharp :: write last line txt file c# 
Csharp :: what is failure 
Csharp :: enum in combobox wpf 
Csharp :: .net core get runtime version 
Csharp :: array sum c# 
Csharp :: How to set default page asp.net MVC 
Csharp :: C# assigning image location 
Csharp :: strinng.indexOf c# 
Csharp :: c# read file stream 
Csharp :: static initializer 
Csharp :: strong email validation regex c# 
Csharp :: unity animation length 
Csharp :: FiveM pc key code 
Csharp :: how to get the dynamic year for your web app in mvc 
Csharp :: how to instantiate more enemies in unity 
Csharp :: csharp-for-loop 
Csharp :: fix autofill issue asp.net mvc 
Csharp :: dsharp emoji from string 
Csharp :: enzymes chemical factory 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =