Partage via


CryptographicOperations.HashDataAsync Méthode

Définition

Surcharges

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

Calcule de façon asynchrone le hachage d’un flux.

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

Calcule de façon asynchrone le hachage d’un flux.

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

Source:
CryptographicOperations.cs

Calcule de façon asynchrone le hachage d’un flux.

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

Paramètres

hashAlgorithm
HashAlgorithmName

Algorithme utilisé pour calculer le hachage.

source
Stream

Flux de hachage.

cancellationToken
CancellationToken

Jeton à surveiller pour les demandes d’annulation. La valeur par défaut est None.

Retours

Hachage des données.

Exceptions

source est null.

-ou-

hashAlgorithm a un Namenull.

hashAlgorithm a une Name vide.

-ou-

source ne prend pas en charge la lecture.

hashAlgorithm spécifie un algorithme de hachage non pris en charge par la plateforme actuelle.

hashAlgorithm spécifie un algorithme de hachage inconnu.

cancellationToken a été annulé.

S’applique à

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

Source:
CryptographicOperations.cs

Calcule de façon asynchrone le hachage d’un flux.

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

Paramètres

hashAlgorithm
HashAlgorithmName

Algorithme utilisé pour calculer le hachage.

source
Stream

Flux de hachage.

destination
Memory<Byte>

Mémoire tampon pour recevoir la valeur de hachage.

cancellationToken
CancellationToken

Jeton à surveiller pour les demandes d’annulation. La valeur par défaut est None.

Retours

Nombre total d’octets écrits dans destination.

Exceptions

source est null.

-ou-

hashAlgorithm a un Namenull.

La mémoire tampon dans destination est trop petite pour contenir la taille de hachage calculée.

-ou-

hashAlgorithm a une Name vide.

-ou-

source ne prend pas en charge la lecture.

hashAlgorithm spécifie un algorithme de hachage non pris en charge par la plateforme actuelle.

hashAlgorithm spécifie un algorithme de hachage inconnu.

cancellationToken a été annulé.

S’applique à