<PackageReference Include="Microsoft.Bcl.Cryptography" Version="10.0.12" />

System.Security.Cryptography.IncrementalHash

sealed class IncrementalHash : IDisposable
Provides support for computing a hash or HMAC value incrementally across several segments.

Get the name of the algorithm being performed.

public static IncrementalHash CreateHash(HashAlgorithmName hashAlgorithm)

Create an IncrementalHash for the algorithm specified by hashAlgorithm.

public static IncrementalHash CreateHMAC(HashAlgorithmName hashAlgorithm, byte[] key)

Create an IncrementalHash for the Hash-based Message Authentication Code (HMAC) algorithm utilizing the hash algorithm specified by hashAlgorithm, and a key specified by key.

public void AppendData(byte[] data)

Append the entire contents of data to the data already processed in the hash or HMAC.

public void AppendData(byte[] data, int offset, int count)

Append count bytes of data, starting at offset, to the data already processed in the hash or HMAC.

public void Dispose()

Release all resources used by the current instance of the IncrementalHash class.

public byte[] GetHashAndReset()

Retrieve the hash or HMAC for the data accumulated from prior calls to AppendData, and return to the state the object was in at construction.