Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

C# BCrypt

using BCrypt.Net;

public class Hashing
{
	private static string GetRandomSalt()
	{
		return BCrypt.GenerateSalt(12);
	}

	public static string HashPassword(string password)
	{
		return BCrypt.HashPassword(password, GetRandomSalt());
	}

	public static bool ValidatePassword(string password, string correctHash)
	{
		return BCrypt.Verify(password, correctHash);
	}
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity random range 
Csharp :: how to convert nullable datetime datarow to datetime in c# 
Csharp :: update models with ef core 
Csharp :: list with two values c# 
Csharp :: how to save a c# dictionary 
Csharp :: how to sort string array alphabetically in c# 
Csharp :: c# afficher texte 
Csharp :: c sharp list length 
Csharp :: replace elements with greatest element on right side 
Csharp :: convert string to date in c# 
Csharp :: how to loop over array in c# 
Csharp :: unity spherecast 
Csharp :: linq distinct count 
Csharp :: C# removing the last value of an array 
Csharp :: swaggergen add service not getting info in .net core 
Csharp :: How to create connection string dynamically in C# 
Csharp :: c# run loop x times 
Csharp :: c# integer to bit string 
Csharp :: how to get hours and minutes from second in c# 
Csharp :: c# making a folder 
Csharp :: c# shuffle 
Csharp :: access to element in object c# 
Csharp :: c# entity framework group by 
Csharp :: get enum name 
Csharp :: get type of variable c# 
Csharp :: int to bool c# 
Csharp :: c# consuming post rest service 
Csharp :: how to open website from c# program 
Csharp :: c# change label from thread 
Csharp :: unity string lowercase 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =