Beispiel #1
0
        public static ValidatePasswordModel HashPassword(string password, int saltSize)
        {
            var validatePasswordModel = new ValidatePasswordModel();

            validatePasswordModel.Salt           = GetRandomSalt(saltSize);
            validatePasswordModel.HashedPassword = BCrypt.Net.BCrypt.HashPassword(password, validatePasswordModel.Salt);
            return(validatePasswordModel);
        }
Beispiel #2
0
        public static ValidatePasswordModel HashPassword(string password, string salt)
        {
            var validatePasswordModel = new ValidatePasswordModel
            {
                HashedPassword = BCrypt.Net.BCrypt.HashPassword(password, salt)
            };

            return(validatePasswordModel);
        }