Shake128.HashDataAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HashDataAsync(Stream, Int32, CancellationToken) |
Asynchronously computes the hash of a stream using the SHAKE128 algorithm. |
HashDataAsync(Stream, Memory<Byte>, CancellationToken) |
Asynchronously computes the hash of a stream using the SHAKE128 algorithm. |
HashDataAsync(Stream, Int32, CancellationToken)
- Source:
- Shake128.cs
- Source:
- Shake128.cs
Asynchronously computes the hash of a stream using the SHAKE128 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 SHAKE128. Callers can use the IsSupported property to determine if the platform supports SHAKE128.
Applies to
HashDataAsync(Stream, Memory<Byte>, CancellationToken)
- Source:
- Shake128.cs
- Source:
- Shake128.cs
Asynchronously computes the hash of a stream using the SHAKE128 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.
- 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 SHAKE128. Callers can use the IsSupported property to determine if the platform supports SHAKE128.