public static string GetHash(string s)
        {
            var encode = PasswordHashAlgorithm.ComputeHash(PasswordEncoding.GetBytes(s));

            return(PasswordEncoding.GetString(encode));
        }
Exemple #2
0
 /// <summary>
 /// Generates a password hash using a hash algorithm
 /// </summary>
 /// <param name="password"></param>
 /// <returns></returns>
 private string GeneratePassHash(string password)
 {
     return(Encoding.UTF8.GetString(PasswordHashAlgorithm.ComputeHash(Encoding.UTF8.GetBytes(password))));
 }