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

傳回

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

適用於