Share via


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 的位元組總數。 這個參數會被視為未初始化。

傳回

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

備註

此方法預設實作是呼叫 HashFinal() 並將結果 destination複製到 。

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

類別 HashAlgorithm 對這個方法的所有呼叫都已經根據 屬性驗證 destination 過夠 HashSize 長,因此 false 傳回值是非預期的。

適用於