Candor.Security.Cryptography.SHA2HashProvider.Hash C# (CSharp) Метод

Hash() публичный Метод

Creates a non-reversible hashed value consistently given the same input.
public Hash ( string salt, string originalValue, int iterations ) : string
salt string Another semi-secret value paired with the secret to /// make it more difficult to dictionary attack a collection of hashed values.
originalValue string The original value to keep secret.
iterations int The iterations to hash the originalValue and salt.
Результат string
        public override string Hash(string salt, string originalValue, int iterations)
        {
            if (iterations < 500)
                throw new ArgumentOutOfRangeException("iterations", "hash iterations must be equal to or greater than 500");
            String passwordHashed = originalValue;
            for (Int32 i = 1; i <= iterations; i++)
            {
                passwordHashed = Sha256Hex(salt + passwordHashed + SaltModifier ?? "");
            }
            return passwordHashed;
        }