语言

NonCryptographicHashAlgorithm 类

定义

表示非加密哈希算法。

public ref class NonCryptographicHashAlgorithm abstract
public abstract class NonCryptographicHashAlgorithm
type NonCryptographicHashAlgorithm = class
Public MustInherit Class NonCryptographicHashAlgorithm
继承
NonCryptographicHashAlgorithm
派生

构造函数

名称 说明
NonCryptographicHashAlgorithm(Int32)

从派生类中的构造函数调用以初始化 NonCryptographicHashAlgorithm 类。

属性

名称 说明
HashLengthInBytes

获取由此哈希算法生成的字节数。

方法

名称 说明
Append(Byte[])

将已处理的数据的内容 source 追加到当前哈希计算中。

Append(ReadOnlySpan<Byte>)

在派生类中重写时,将已处理的数据的内容 source 追加到当前哈希计算中。

Append(Stream)

将已处理的数据的内容 stream 追加到当前哈希计算中。

AppendAsync(Stream, CancellationToken)

异步读取 stream 当前哈希计算已处理的数据,并将其追加到已处理的数据中。

GetCurrentHash()

获取当前计算的哈希值,而不修改累积状态。

GetCurrentHash(Span<Byte>)

将计算的哈希值 destination 写入到不修改累积状态。

GetCurrentHashCore(Span<Byte>)

在派生类中重写时,将计算的哈希值 destination 写入到不修改累积状态。

GetHashAndReset()

获取当前计算的哈希值并清除累积状态。

GetHashAndReset(Span<Byte>)

写入计算的哈希值,然后 destination 清除累积状态。

GetHashAndResetCore(Span<Byte>)

写入计算的哈希值,然后 destination 清除累积状态。

GetHashCode()
已过时.

此方法不受支持,不应调用。 呼叫 GetCurrentHash() 或 GetHashAndReset() 改为。

Reset()

在派生类中重写时,将哈希计算重置为初始状态。

TryGetCurrentHash(Span<Byte>, Int32)

尝试在不修改累积状态的情况下将计算的哈希值写入到该哈希值 destination 。

TryGetHashAndReset(Span<Byte>, Int32)

尝试将计算的哈希值 destination写入到 . 如果成功,则清除累积状态。

适用于