HashAlgorithm.TryHashFinal(Span<Byte>, Int32) 方法

定義

在雜湊演算法處理最後一筆資料之後,嘗試完成雜湊計算。

protected:
 virtual bool TryHashFinal(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryHashFinal (Span<byte> destination, out int bytesWritten);
abstract member TryHashFinal : Span<byte> * int -> bool
override this.TryHashFinal : Span<byte> * int -> bool
Protected Overridable Function TryHashFinal (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

參數

destination
Span<Byte>

要接收雜湊值的緩衝區。

bytesWritten
Int32

當這個方法傳回時,寫入 destination 的位元組總數。 這個參數會被視為未初始化。

傳回

Boolean

如果 destination 的長度足以接收雜湊值,則為 true;否則為 false

備註

這個方法的預設執行是呼叫 HashFinal() 並將結果複製到 destination

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

此類別的所有呼叫都已 HashAlgorithm 驗證的 destination 長度是否夠長,以屬性為基礎 HashSize ,因此傳回 false 值是非預期的。

適用於