IncrementalHash.TryGetHashAndReset(Span<Byte>, Int32) Method

Definition

Attempts to finalize the hash computation after the last data is processed by the hash algorithm.

C#
public bool TryGetHashAndReset(Span<byte> destination, out int bytesWritten);

Parameters

destination
Span<Byte>

The buffer to receive the hash or Hash-Based Message Authentication Code (HMAC) value.

bytesWritten
Int32

When this method returns, the total number of bytes written into destination. This parameter is treated as uninitialized.

Returns

true if destination is long enough to receive the hash or HMAC value; otherwise, false.

Exceptions

The IncrementalHash object has already been disposed.

Applies to

Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Standard 2.1