DSA.TryHashData Metoda

Definicja

Próbuje obliczyć wartość skrótu podanych danych w udostępnionym buforze.

protected:
 virtual bool TryHashData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryHashData (ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten);
abstract member TryHashData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
override this.TryHashData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
Protected Overridable Function TryHashData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, ByRef bytesWritten As Integer) As Boolean

Parametry

data
ReadOnlySpan<Byte>

Dane, które mają zostać skrócone.

destination
Span<Byte>

Zakres bajtów do odbierania wartości skrótu.

hashAlgorithm
HashAlgorithmName

Nazwa algorytmu mieszania do użycia.

bytesWritten
Int32

Gdy ta metoda zwraca wartość , zawiera wartość, która wskazuje liczbę bajtów zapisanych w obiekcie destination.

Zwraca

truejeśli destination jest wystarczająco duży, aby otrzymać wynik; w przeciwnym razie . false

Uwagi

Domyślną implementacją tej metody jest wywołanie HashData(Byte[], Int32, Int32, HashAlgorithmName) i skopiowanie wyniku do destinationmetody .

Typy pochodne powinny zastąpić tę metodę, aby uniknąć tworzenia tablicy pośredniej.

Dotyczy