Exemplo n.º 1
0
        public IActionResult Get()
        {
            string salt = HashManager.CreateSalt();
            string hash = HashManager.CreateHash("123123", salt);

            return(Ok(new { salt = salt, hash = hash }));
        }
Exemplo n.º 2
0
        public override void Save(Usuario entity)
        {
            string salt         = HashManager.CreateSalt();
            string hashPassword = HashManager.CreateHash(entity.Password, salt);

            entity.Salt     = salt;
            entity.Password = hashPassword;
            base.Save(entity);
        }