SHA256.TryHashData(ReadOnlySpan<Byte>, Span<Byte>, Int32) Method

Definition

Attempts to compute the hash of data using the SHA256 algorithm.

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

Parameters

source
ReadOnlySpan<Byte>

The data to hash.

destination
Span<Byte>

The buffer to receive the hash value.

bytesWritten
Int32

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

Returns

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

Applies to

Produkt Versioner
.NET 5, 6, 7, 8, 9