SHA256.TryHashData(ReadOnlySpan<Byte>, Span<Byte>, Int32) 方法
定义
尝试使用 SHA256 算法计算数据的哈希值。Attempts to compute the hash of data using the SHA256 algorithm.
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>
要进行哈希处理的数据。The data to hash.
- bytesWritten
- Int32
此方法返回时,为写入 destination
的字节总数。When this method returns, the total number of bytes written into destination
.
返回
如果 destination
太小,无法容纳计算所得的哈希,则为 false
;否则为 true
。false
if destination
is too small to hold the calculated hash, true
otherwise.