DSA.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 的字节数的值。

返回

Boolean

如果 destination 足够大可以接收结果,则为 true;否则为 false

注解

此方法的默认实现是调用 HashData(Byte[], Int32, Int32, HashAlgorithmName) 结果 destination并将其复制到 。

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

适用于