using System.Security.Cryptography; public byte[] ComputeHash(byte[] data) { using (SHA256Managed sha256 = new SHA256Managed()) { return sha256.ComputeHash(data); } }
using System.Security.Cryptography; public void ClearInternalState(SHA256Managed sha256) { sha256.Clear(); }This method is used to clear the internal state of the Sha256Managed object. The package library for the System.Security.Cryptography namespace is part of the .NET Core runtime.