CryptographicOperations.TryHashData メソッド

定義

データのハッシュの計算を試みます。

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

パラメーター

hashAlgorithm
HashAlgorithmName

ハッシュの計算に使用されるアルゴリズム。

source
ReadOnlySpan<Byte>

ハッシュするデータ。

destination
Span<Byte>

ハッシュ値を受け取るバッファー。

bytesWritten
Int32

このメソッドが返されるときに、destinationに書き込まれたバイトの合計数。

戻り値

false destination が小さすぎて計算されたハッシュを保持できない場合は、それ以外の場合 true

例外

hashAlgorithm に空の Name があります。

hashAlgorithm には、nullされている Name があります。

hashAlgorithm は、現在のプラットフォームでサポートされていないハッシュ アルゴリズムを指定します。

hashAlgorithm は、不明なハッシュ アルゴリズムを指定します。

適用対象