DotNext by Roman Sakno

<PackageReference Include="DotNext" Version="2.8.0" />

 HashBuilder

Represents convenient facade for HashAlgorithm to avoid memory allocations during hash computing.
public int HashSize { get; }

Gets the size, in bits, of the computed hash code.

public bool IsEmpty { get; }

Gets a value indicating that this object is not initialized.

public HashBuilder(HashAlgorithm algorithm, bool leaveOpen = true)

Wraps the specified hash algorithm.

public HashBuilder(string hashName)

Initializes a new hash builder using the specified hash algorithm.

public void Add(ReadOnlySpan<byte> bytes)

Adds a series of bytes to the hash code.

public void Add(ReadOnlySequence<byte> bytes)

Adds a series of bytes to the hash code.

Adds a single value to the hash code.

public int Build(Span<byte> hash)

Calculates the final hash.

public void Dispose()

Releases all resources associated with underlying hash algorithm.

public void Reset()

Resets internal state of hash algorithm.