ECDsa.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 不夠長,無法接收雜湊值,則為 false

備註

此方法的預設實作是呼叫 HashData(Byte[], Int32, Int32, HashAlgorithmName) 並將結果 destination 複製到 。 衍生型別應該覆寫這個方法,以避免建立中繼陣列。

適用於