System.Security.Cryptography.SHA256CryptoServiceProvider.Dispose C# (CSharp) Метод

Dispose() приватный Метод

private Dispose ( bool disposing ) : void
disposing bool
Результат void
		protected override void Dispose (bool disposing)
		{
			(hash as IDisposable).Dispose ();
			base.Dispose (disposing);
		}
	}

Usage Example

Пример #1
0
        private NewPassword HashPassword(NewPassword np)
        {
            HashAlgorithm hashAlg = null;

            try
            {
                hashAlg = new SHA256CryptoServiceProvider();
                byte[] bytValue = System.Text.Encoding.UTF8.GetBytes(np.GetSaltPassword());
                byte[] bytHash = hashAlg.ComputeHash(bytValue);
                np.SaltedHashedPassword = Convert.ToBase64String(bytHash);
            }
            catch (Exception e)
            {
                throw e;
            }
            finally
            {
                if (hashAlg != null)
                {
                    hashAlg.Clear();
                    hashAlg.Dispose();
                    hashAlg = null;
                }
            }

            return np;
        }
All Usage Examples Of System.Security.Cryptography.SHA256CryptoServiceProvider::Dispose