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到的字节总数。 此参数被视为未初始化。

返回

true 如果 destination 足够长,无法接收哈希值,则为 ;否则为 false

注解

此方法的默认实现是调用 HashFinal() 结果 destination并将其复制到 。

派生类型应重写此方法以避免创建中间数组。

类对此方法 HashAlgorithm 的所有调用都已验证 destination 是否足够长, HashSize 具体取决于属性,因此 false 返回值是意外的。

适用于