IncrementalHash IncrementalHash IncrementalHash IncrementalHash Class

定义

支持跨多个段以增量方式计算哈希或基于哈希的消息验证代码 (HMAC) 值。Provides support for computing a hash or Hash-based Message Authentication Code (HMAC) value incrementally across several segments.

public ref class IncrementalHash sealed : IDisposable
public sealed class IncrementalHash : IDisposable
type IncrementalHash = class
    interface IDisposable
Public NotInheritable Class IncrementalHash
Implements IDisposable
继承
IncrementalHashIncrementalHashIncrementalHashIncrementalHash
实现

属性

AlgorithmName AlgorithmName AlgorithmName AlgorithmName

获取正在执行的算法的名称。Gets the name of the algorithm being performed. HMAC 算法前面附有“HMAC”,以区别于未经加密的摘要。HMAC algorithms are prepended with "HMAC" to distinguish them from an unkeyed digest.

方法

AppendData(Byte[]) AppendData(Byte[]) AppendData(Byte[]) AppendData(Byte[])

将指定数据追加到已进行哈希或 HMAC 处理的数据。Appends the specified data to the data already processed in the hash or HMAC.

AppendData(Byte[], Int32, Int32) AppendData(Byte[], Int32, Int32) AppendData(Byte[], Int32, Int32) AppendData(Byte[], Int32, Int32)

从指定偏移量开始,向已经过哈希或基于哈希的消息验证代码 (HMAC) 处理的数据追加指定数据的指定字节数。Appends the specified number of bytes from the specified data, starting at the specified offset, to the data already processed in the hash or Hash-based Message Authentication Code (HMAC).

AppendData(ReadOnlySpan<Byte>) AppendData(ReadOnlySpan<Byte>) AppendData(ReadOnlySpan<Byte>) AppendData(ReadOnlySpan<Byte>)
CreateHash(HashAlgorithmName) CreateHash(HashAlgorithmName) CreateHash(HashAlgorithmName) CreateHash(HashAlgorithmName)

为指定算法创建 IncrementalHashCreates an IncrementalHash for the specified algorithm.

CreateHMAC(HashAlgorithmName, Byte[]) CreateHMAC(HashAlgorithmName, Byte[]) CreateHMAC(HashAlgorithmName, Byte[]) CreateHMAC(HashAlgorithmName, Byte[])

使用指定的哈希算法和密钥为基于哈希的消息验证代码 (HMAC) 算法创建 IncrementalHashCreates an IncrementalHash for the Hash-based Message Authentication Code (HMAC) algorithm using the specified hash algorithm and key.

Dispose() Dispose() Dispose() Dispose()

释放 IncrementalHash 类的当前实例使用的资源。Releases the resources used by the current instance of the IncrementalHash class.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashAndReset() GetHashAndReset() GetHashAndReset() GetHashAndReset()

检索哈希或基于哈希的消息验证代码 (HMAC)(用于从之前对 AppendData(Byte[]) 方法的调用中累积的数据),并将对象重置为初始状态。Retrieves the hash or Hash-based Message Authentication Code (HMAC) for the data accumulated from prior calls to the AppendData(Byte[]) method, and resets the object to its initial state.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)
TryGetHashAndReset(Span<Byte>, Int32) TryGetHashAndReset(Span<Byte>, Int32) TryGetHashAndReset(Span<Byte>, Int32) TryGetHashAndReset(Span<Byte>, Int32)

适用于