SHA256.TryHashData(ReadOnlySpan<Byte>, Span<Byte>, Int32) 方法

定义

尝试使用 SHA-256 算法计算数据的哈希。

public:
 static bool TryHashData(ReadOnlySpan<System::Byte> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryHashData(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten);
static member TryHashData : ReadOnlySpan<byte> * Span<byte> * int -> bool
Public Shared Function TryHashData (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到的字节总数。

返回

如果 太小而无法保存计算的哈希,则为 ;否则为 />。

适用于