/// <summary> /// Creates a salted password hash using a strong one-way hashing algorithm. /// </summary> /// <param name="password">The password being hashed</param> /// <param name="hashAlgorithm">Algorithm to use to generate the hash</param> /// <returns>The hash of the given password</returns> public static string GeneratePasswordHashWithAlgorithm(string password, IHash hashAlgorithm) { // The MD5 hash don't add any separators to keep the same behavior as before... So simply invoke its ApplyAlgorithm method... return((hashAlgorithm == MD5Hash.Instance)? hashAlgorithm.ApplyAlgorithm(password): hashes.ApplySpecificAlgorithm(password, hashAlgorithm)); }