DSA.TryHashData 方法

定義

嘗試在所提供緩衝區中計算所提供資料的雜湊值。

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

參數

data
ReadOnlySpan<Byte>

要雜湊的資料。

destination
Span<Byte>

要接收雜湊值的位元組範圍。

hashAlgorithm
HashAlgorithmName

要使用的雜湊演算法的名稱。

bytesWritten
Int32

當此方法傳回時,會包含一個值,指出寫入 destination 的位元組數。

傳回

destination 夠大可接收結果,則為 true;否則為 false

備註

這個方法的預設實作是呼叫 HashData(Byte[], Int32, Int32, HashAlgorithmName) 並將結果 destination 複製到 。

衍生型別應該覆寫這個方法,以避免建立中繼陣列。

適用於