Kmac128.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(ReadOnlyMemory<Byte>, Stream, Memory<Byte>, ReadOnlyMemory<Byte>, CancellationToken) |
Asynchronously computes the hash of a stream using the KMAC128 algorithm. |
HashDataAsync(Byte[], Stream, Int32, Byte[], CancellationToken) |
Asynchronously computes the hash of a stream using the KMAC128 algorithm. |
HashDataAsync(ReadOnlyMemory<Byte>, Stream, Int32, ReadOnlyMemory<Byte>, CancellationToken) |
Asynchronously computes the hash of a stream using the KMAC128 algorithm. |
HashDataAsync(ReadOnlyMemory<Byte>, Stream, Memory<Byte>, ReadOnlyMemory<Byte>, CancellationToken)
- Source:
- Kmac128.cs
Asynchronously computes the hash of a stream using the KMAC128 algorithm.
public static System.Threading.Tasks.ValueTask HashDataAsync (ReadOnlyMemory<byte> key, System.IO.Stream source, Memory<byte> destination, ReadOnlyMemory<byte> customizationString = default, System.Threading.CancellationToken cancellationToken = default);
static member HashDataAsync : ReadOnlyMemory<byte> * System.IO.Stream * Memory<byte> * ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask
Public Shared Function HashDataAsync (key As ReadOnlyMemory(Of Byte), source As Stream, destination As Memory(Of Byte), Optional customizationString As ReadOnlyMemory(Of Byte) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask
Parameters
- key
- ReadOnlyMemory<Byte>
The KMAC key.
- source
- Stream
The stream to hash.
- customizationString
- ReadOnlyMemory<Byte>
An optional customization string. The default is no customization string.
- 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.
An error has occurred during the operation.
cancellationToken
has been canceled.
The platform does not support KMAC128. Callers can use the IsSupported property to determine if the platform supports KMAC128.
Applies to
HashDataAsync(Byte[], Stream, Int32, Byte[], CancellationToken)
- Source:
- Kmac128.cs
Asynchronously computes the hash of a stream using the KMAC128 algorithm.
public static System.Threading.Tasks.ValueTask<byte[]> HashDataAsync (byte[] key, System.IO.Stream source, int outputLength, byte[]? customizationString = default, System.Threading.CancellationToken cancellationToken = default);
static member HashDataAsync : byte[] * System.IO.Stream * int * byte[] * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<byte[]>
Public Shared Function HashDataAsync (key As Byte(), source As Stream, outputLength As Integer, Optional customizationString As Byte() = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Byte())
Parameters
- key
- Byte[]
The KMAC key.
- source
- Stream
The stream to hash.
- outputLength
- Int32
The size of the hash to produce.
- customizationString
- Byte[]
An optional customization string. The default is no customization string.
- 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
key
or source
is null
.
source
does not support reading.
outputLength
is negative.
An error has occurred during the operation.
cancellationToken
has been canceled.
The platform does not support KMAC128. Callers can use the IsSupported property to determine if the platform supports KMAC128.
Applies to
HashDataAsync(ReadOnlyMemory<Byte>, Stream, Int32, ReadOnlyMemory<Byte>, CancellationToken)
- Source:
- Kmac128.cs
Asynchronously computes the hash of a stream using the KMAC128 algorithm.
public static System.Threading.Tasks.ValueTask<byte[]> HashDataAsync (ReadOnlyMemory<byte> key, System.IO.Stream source, int outputLength, ReadOnlyMemory<byte> customizationString = default, System.Threading.CancellationToken cancellationToken = default);
static member HashDataAsync : ReadOnlyMemory<byte> * System.IO.Stream * int * ReadOnlyMemory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<byte[]>
Public Shared Function HashDataAsync (key As ReadOnlyMemory(Of Byte), source As Stream, outputLength As Integer, Optional customizationString As ReadOnlyMemory(Of Byte) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Byte())
Parameters
- key
- ReadOnlyMemory<Byte>
The KMAC key.
- source
- Stream
The stream to hash.
- outputLength
- Int32
The size of the hash to produce.
- customizationString
- ReadOnlyMemory<Byte>
An optional customization string. The default is no customization string.
- 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
is null
.
source
does not support reading.
outputLength
is negative.
An error has occurred during the operation.
cancellationToken
has been canceled.
The platform does not support KMAC128. Callers can use the IsSupported property to determine if the platform supports KMAC128.