IncrementalHash.GetHashAndReset Method

Definition

Overloads

GetHashAndReset()

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

GetHashAndReset(Span<Byte>)

Retrieves the hash or Hash-based Message Authentication Code (HMAC) for the data accumulated from prior calls to the AppendData(ReadOnlySpan<Byte>) methods, and resets the object to its initial state.

GetHashAndReset()

Source:
IncrementalHash.cs
Source:
IncrementalHash.cs
Source:
IncrementalHash.cs

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

C#
public byte[] GetHashAndReset();

Returns

Byte[]

The computed hash or HMAC.

Exceptions

The object has already been disposed.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.3, 1.4, 1.6, 2.0, 2.1

GetHashAndReset(Span<Byte>)

Source:
IncrementalHash.cs
Source:
IncrementalHash.cs
Source:
IncrementalHash.cs

Retrieves the hash or Hash-based Message Authentication Code (HMAC) for the data accumulated from prior calls to the AppendData(ReadOnlySpan<Byte>) methods, and resets the object to its initial state.

C#
public int GetHashAndReset(Span<byte> destination);

Parameters

destination
Span<Byte>

The buffer to receive the hash or HMAC value.

Returns

The number of bytes written to destination.

Exceptions

destination has a Length value less than HashLengthInBytes.

The object has already been disposed.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10