public static T GenerateHash <T>(string password, string salt, GenerateHashDelegate <T> callback) { var saltBytes = PasswordToolkit.HashHexStringToBytes(salt); var hash = PasswordToolkit.PasswordToHashHexString(saltBytes, PasswordToolkit.PasswordToHashHexString(saltBytes, password)); return(callback(salt, hash)); }
public static T GenerateHash <T>(string password, GenerateHashDelegate <T> callback) { var saltBytes = PasswordToolkit.GetRandomSalt(); var hash = PasswordToolkit.PasswordToHashHexString(saltBytes, PasswordToolkit.PasswordToHashHexString(saltBytes, password)); var salt = PasswordToolkit.HashBytesToHexString(saltBytes); return(callback(salt, hash)); }