Compartir vía


CryptographicOperations.TryHashData Método

Definición

Intenta calcular el hash de los datos.

public:
 static bool TryHashData(System::Security::Cryptography::HashAlgorithmName hashAlgorithm, ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryHashData (System.Security.Cryptography.HashAlgorithmName hashAlgorithm, ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
static member TryHashData : System.Security.Cryptography.HashAlgorithmName * ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Shared Function TryHashData (hashAlgorithm As HashAlgorithmName, source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parámetros

hashAlgorithm
HashAlgorithmName

Algoritmo usado para calcular el hash.

source
ReadOnlySpan<Byte>

Datos que se van a aplicar hash.

destination
Span<Byte>

Búfer que va a recibir el valor hash.

bytesWritten
Int32

Cuando este método devuelve, el número total de bytes escritos en destination.

Devoluciones

false si destination es demasiado pequeño para contener el hash calculado, true de lo contrario.

Excepciones

hashAlgorithm tiene un Name que está vacío.

hashAlgorithm tiene un Name que es null.

hashAlgorithm especifica un algoritmo hash no compatible con la plataforma actual.

hashAlgorithm especifica un algoritmo hash desconocido.

Se aplica a