PasswordHelper - Aghyad-Khlefawi/Coddee GitHub Wiki
A static class containing a helper functions for hashing passwords.
Methods
| Name | Description |
|---|---|
| GenerateHashedPassword(string) | Hashes a string and return a result formated in Base64 |
| ValidatePassword(string,string,string) | Validate a Base64 password value |
C# Example:
string myPassword = "VERYSTRONGPASSWORD";
HashedPassword hashedPassword = PasswordHelper.GenerateHashedPassword(myPassword);
Debug.WriteLine(hashedPassword.Password); //outputs: DD8JPzUHCz8/Pz8/G0o/Pz98P30/bD8/Pz96Pz8BaiI=
var isValid = PasswordHelper.ValidatePassword(myPassword, hashedPassword.Salt, hashedPassword.Password);
Console.WriteLine(isValid); //outputs: true