Uredi

Deli z drugimi prek


HMACMD5.HashDataAsync Method

Definition

Overloads

HashDataAsync(Byte[], Stream, CancellationToken)

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

HashDataAsync(ReadOnlyMemory<Byte>, Stream, CancellationToken)

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

HashDataAsync(ReadOnlyMemory<Byte>, Stream, Memory<Byte>, CancellationToken)

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

HashDataAsync(Byte[], Stream, CancellationToken)

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

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

Parameters

key
Byte[]

The HMAC key.

source
Stream

The stream to HMAC.

cancellationToken
CancellationToken

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

Returns

The HMAC of the data.

Attributes

Exceptions

key or source is null.

source does not support reading.

The cancellation token was canceled. This exception is stored into the returned task.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by HashData(Byte[], Stream).

Applies to

HashDataAsync(ReadOnlyMemory<Byte>, Stream, CancellationToken)

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Threading.Tasks.ValueTask<byte[]> HashDataAsync (ReadOnlyMemory<byte> key, System.IO.Stream source, System.Threading.CancellationToken cancellationToken = default);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member HashDataAsync : ReadOnlyMemory<byte> * System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<byte[]>
Public Shared Function HashDataAsync (key As ReadOnlyMemory(Of Byte), source As Stream, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Byte())

Parameters

key
ReadOnlyMemory<Byte>

The HMAC key.

source
Stream

The stream to HMAC.

cancellationToken
CancellationToken

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

Returns

The HMAC of the data.

Attributes

Exceptions

source is null.

source does not support reading.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

HashDataAsync(ReadOnlyMemory<Byte>, Stream, Memory<Byte>, CancellationToken)

Source:
HMACMD5.cs
Source:
HMACMD5.cs
Source:
HMACMD5.cs

Asynchronously computes the HMAC of a stream using the MD5 algorithm.

[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
public static System.Threading.Tasks.ValueTask<int> HashDataAsync (ReadOnlyMemory<byte> key, System.IO.Stream source, Memory<byte> destination, System.Threading.CancellationToken cancellationToken = default);
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
static member HashDataAsync : ReadOnlyMemory<byte> * System.IO.Stream * Memory<byte> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<int>
Public Shared Function HashDataAsync (key As ReadOnlyMemory(Of Byte), source As Stream, destination As Memory(Of Byte), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Integer)

Parameters

key
ReadOnlyMemory<Byte>

The HMAC key.

source
Stream

The stream to HMAC.

destination
Memory<Byte>

The buffer to receive the HMAC value.

cancellationToken
CancellationToken

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

Returns

The total number of bytes written to destination.

Attributes

Exceptions

source is null.

The buffer in destination is too small to hold the calculated hash size. The MD5 algorithm always produces a 128-bit hash, or 16 bytes.

-or-

source does not support reading.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to