Shake256.HashDataAsync Method

Definition

Overloads

HashDataAsync(Stream, Int32, CancellationToken)

Asynchronously computes the hash of a stream using the SHAKE256 algorithm.

HashDataAsync(Stream, Memory<Byte>, CancellationToken)

Asynchronously computes the hash of a stream using the SHAKE256 algorithm.

HashDataAsync(Stream, Int32, CancellationToken)

Source:
Shake256.cs
Source:
Shake256.cs

Asynchronously computes the hash of a stream using the SHAKE256 algorithm.

public static System.Threading.Tasks.ValueTask<byte[]> HashDataAsync (System.IO.Stream source, int outputLength, System.Threading.CancellationToken cancellationToken = default);
static member HashDataAsync : System.IO.Stream * int * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<byte[]>
Public Shared Function HashDataAsync (source As Stream, outputLength As Integer, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Byte())

Parameters

source
Stream

The stream to hash.

outputLength
Int32

The size of the hash to produce.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A ValueTask<TResult> that completes with the computed hash.

Exceptions

source does not support reading.

outputLength is negative.

source is null.

cancellationToken has been canceled.

The platform does not support SHAKE256. Callers can use the IsSupported property to determine if the platform supports SHAKE256.

Applies to

HashDataAsync(Stream, Memory<Byte>, CancellationToken)

Source:
Shake256.cs
Source:
Shake256.cs

Asynchronously computes the hash of a stream using the SHAKE256 algorithm.

public static System.Threading.Tasks.ValueTask HashDataAsync (System.IO.Stream source, Memory<byte> destination, System.Threading.CancellationToken cancellationToken = default);
static member HashDataAsync : System.IO.Stream * Memory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Shared Function HashDataAsync (source As Stream, destination As Memory(Of Byte), Optional cancellationToken As CancellationToken = Nothing) As ValueTask

Parameters

source
Stream

The stream to hash.

destination
Memory<Byte>

The buffer to fill with the hash.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A ValueTask that represents the asynchronous operation.

Exceptions

source is null.

source does not support reading.

cancellationToken has been canceled.

The platform does not support SHAKE256. Callers can use the IsSupported property to determine if the platform supports SHAKE256.

Applies to