/// <summary> /// Generate a password hash against a given salt and password. /// </summary> /// <param name="hasher">The current <see cref="IHashPasswords"/> implementation.</param> /// <param name="salt">A sequence of bytes representing a salt.</param> /// <param name="password">A string representing a clear password.</param> /// <param name="encoding"> /// An encoding to use for converting the given string password to a sequence of bytes. /// </param> /// <returns> /// A sequence of bytes representing the result of hashing the given salt and password. /// </returns> public static byte[] Hash(this IHashPasswords hasher, byte[] salt, string password, Encoding encoding) { return(hasher.Hash(salt, encoding.GetBytes(password))); }
public RegisterUserService(IUsersRepository usersRepository, IHashPasswords hashPasswords) { _usersRepository = usersRepository; _hashPasswords = hashPasswords; }