RSA.TryHashData Méthode

Définition

Tente de calculer le hachage des données fournies à l’aide de l’algorithme spécifié, en écrivant les résultats dans une mémoire tampon fournie.

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

Paramètres

data
ReadOnlySpan<Byte>

Données à hacher.

destination
Span<Byte>

Mémoire tampon utilisée pour recevoir la valeur de hachage.

hashAlgorithm
HashAlgorithmName

Algorithme à utiliser pour hacher les données.

bytesWritten
Int32

Quand cette méthode est retournée, nombre total d’octets écrits dans destination. Ce paramètre est traité comme étant non initialisé.

Retours

true si destination n’est pas assez long pour recevoir la valeur de hachage ; sinon, false.

Remarques

L’implémentation par défaut de cette méthode appelle HashData(Byte[], Int32, Int32, HashAlgorithmName) et copie le résultat dans destination. Les types dérivés doivent remplacer cette méthode pour éviter la création du tableau intermédiaire.

S’applique à