ECDsa.TryHashData Method

Definition

Attempts to compute the hash value of the specified read-only span of bytes into the provided destination by using the specified hashing algorithm.

C#
protected virtual bool TryHashData(ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten);

Parameters

data
ReadOnlySpan<Byte>

The data to be hashed.

destination
Span<Byte>

The buffer to receive the hash value.

hashAlgorithm
HashAlgorithmName

The algorithm to use to hash the data.

bytesWritten
Int32

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

Returns

false if destination is not long enough to receive the hash value.

Remarks

The default implementation of this method is to call HashData(Byte[], Int32, Int32, HashAlgorithmName) and copy the result to destination. Derived types should override this method to avoid the intermediate array creation.

Applies to

Tuote Versiot
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1