public UserSignUpCommand( UserRepository userRepository, HashingService hashingService, SecurePseudoRandomGenerator securePseudoRandomGenerator) { this.userRepository = userRepository; this.hashingService = hashingService; this.securePseudoRandomGenerator = securePseudoRandomGenerator; }
public void Hash( HashingService hashingService, SecurePseudoRandomGenerator securePseudoRandomGenerator) { Salt salt = securePseudoRandomGenerator.Generate(); var saltedPassword = this.Value + salt.Value; var hashedPassword = hashingService.Hash(saltedPassword); this.Value = hashedPassword; this.SaltProp = salt; }