HashAlgorithm.TryComputeHash 方法

定義

嘗試計算指定位元組陣列的雜湊值。

public:
 bool TryComputeHash(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryComputeHash (ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
member this.TryComputeHash : ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Function TryComputeHash (source As ReadOnlySpan(Of Byte), destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

參數

source
ReadOnlySpan<Byte>

要用來計算雜湊碼的輸入。

destination
Span<Byte>

要接收雜湊值的緩衝區。

bytesWritten
Int32

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

傳回

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

適用於