DSA.TryHashData Metodo

Definizione

Tenta di calcolare il valore hash dei dati forniti in un buffer fornito.

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

Parametri

data
ReadOnlySpan<Byte>

Dati di cui eseguire l'hashing.

destination
Span<Byte>

Intervallo di byte per ricevere il valore hash.

hashAlgorithm
HashAlgorithmName

Nome dell'algoritmo hash da usare.

bytesWritten
Int32

Quando termina, questo metodo contiene un valore che indica il numero di byte scritti in destination.

Valori restituiti

true se destination è sufficientemente grande da ricevere il risultato; in caso contrario, false.

Commenti

L'implementazione predefinita di questo metodo consiste nel chiamare HashData(Byte[], Int32, Int32, HashAlgorithmName) e copiare il risultato in destination.

I tipi derivati devono eseguire l'override di questo metodo per evitare la creazione della matrice intermedia.

Si applica a