ECDsa.TryHashData 方法

定义

尝试使用指定的哈希算法,将指定的只读字节范围的哈希值计算入提供的目标。

protected:
 virtual bool TryHashData(ReadOnlySpan<System::Byte> data, Span<System::Byte> destination, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, [Runtime::InteropServices::Out] int % bytesWritten);
protected virtual bool TryHashData (ReadOnlySpan<byte> data, Span<byte> destination, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, out int bytesWritten);
abstract member TryHashData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
override this.TryHashData : ReadOnlySpan<byte> * Span<byte> * System.Security.Cryptography.HashAlgorithmName * int -> bool
Protected Overridable Function TryHashData (data As ReadOnlySpan(Of Byte), destination As Span(Of Byte), hashAlgorithm As HashAlgorithmName, ByRef bytesWritten As Integer) As Boolean

参数

data
ReadOnlySpan<Byte>

要进行哈希处理的数据。

destination
Span<Byte>

要接收哈希值的缓冲区。

hashAlgorithm
HashAlgorithmName

要用于对数据进行哈希处理的算法。

bytesWritten
Int32

此方法返回时,为写入 destination 的字节总数。 该参数未经初始化即被处理。

返回

如果 destination 不够长,无法接收哈希值,则为 false

注解

此方法的默认实现是调用 HashData(Byte[], Int32, Int32, HashAlgorithmName) 并将结果复制到 destination。 派生类型应重写此方法,以避免创建中间数组。

适用于