HMACSHA512.TryHashData Method

Definition

Attempts to compute the HMAC of data using the SHA512 algorithm.

C#
public static bool TryHashData(ReadOnlySpan<byte> key, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);

Parameters

key
ReadOnlySpan<Byte>

The HMAC key.

source
ReadOnlySpan<Byte>

The data to HMAC.

destination
Span<Byte>

The buffer to receive the HMAC value.

bytesWritten
Int32

When this method returns, contains the total number of bytes written into destination.

Returns

false if destination is too small to hold the calculated hash, true otherwise.

Applies to

Product Versions
.NET 6, 7, 8, 9, 10