CryptographicOperations.HashDataAsync Metoda

Definicja

Przeciążenia

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

Asynchronicznie oblicza skrót strumienia.

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

Asynchronicznie oblicza skrót strumienia.

HashDataAsync(HashAlgorithmName, Stream, CancellationToken)

Źródło:
CryptographicOperations.cs

Asynchronicznie oblicza skrót strumienia.

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())

Parametry

hashAlgorithm
HashAlgorithmName

Algorytm używany do obliczania skrótu.

source
Stream

Strumień do skrótu.

cancellationToken
CancellationToken

Token do monitorowania żądań anulowania. Wartość domyślna to None.

Zwraca

Skrót danych.

Wyjątki

source jest null.

-lub-

hashAlgorithm ma Namenull.

hashAlgorithm ma Name, który jest pusty.

-lub-

source nie obsługuje odczytu.

hashAlgorithm określa algorytm wyznaczania wartości skrótu nieobsługiwany przez bieżącą platformę.

hashAlgorithm określa nieznany algorytm wyznaczania skrótu.

cancellationToken została anulowana.

Dotyczy

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

Źródło:
CryptographicOperations.cs

Asynchronicznie oblicza skrót strumienia.

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)

Parametry

hashAlgorithm
HashAlgorithmName

Algorytm używany do obliczania skrótu.

source
Stream

Strumień do skrótu.

destination
Memory<Byte>

Bufor do odbierania wartości skrótu.

cancellationToken
CancellationToken

Token do monitorowania żądań anulowania. Wartość domyślna to None.

Zwraca

Całkowita liczba bajtów zapisanych w destination.

Wyjątki

source jest null.

-lub-

hashAlgorithm ma Namenull.

Bufor w destination jest zbyt mały, aby pomieścić obliczony rozmiar skrótu.

-lub-

hashAlgorithm ma Name, który jest pusty.

-lub-

source nie obsługuje odczytu.

hashAlgorithm określa algorytm wyznaczania wartości skrótu nieobsługiwany przez bieżącą platformę.

hashAlgorithm określa nieznany algorytm wyznaczania skrótu.

cancellationToken została anulowana.

Dotyczy