public Task <IUser> RegisterUser(IUser user) { //this incoming user's password will need to be salted and hashed, then stored in our repo. var hashedPassword = System.Convert.ToBase64String(_hash.Hash(System.Text.Encoding.UTF8.GetBytes(user.Password), HashProviders.UserAccountSecurity)); var salt = _randomProvider.GenerateString(RandomType.Secure); user.Password = hashedPassword + salt; _users.Add(user); return(Task.FromResult(user)); }
public object Get() { return(new { insecure = _rnd.Generate(), secure = _rnd.Generate(RandomType.Secure), secureString = _rnd.Generate(RandomType.Secure), insecureSring = _rnd.GenerateString(RandomType.InSecure), secureInt = _rnd.GenerateInt(RandomType.Secure), secureDouble = _rnd.GenerateDouble(RandomType.Secure) }); }