HashAlgorithm.HashCore 方法

定义

重载

HashCore(Byte[], Int32, Int32)

当在派生类中重写时,将写入对象的数据路由到哈希算法以计算哈希值。When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash.

HashCore(ReadOnlySpan<Byte>)

将写入对象的数据路由到哈希算法以计算哈希值。Routes data written to the object into the hash algorithm for computing the hash.

HashCore(Byte[], Int32, Int32)

当在派生类中重写时,将写入对象的数据路由到哈希算法以计算哈希值。When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash.

protected:
 abstract void HashCore(cli::array <System::Byte> ^ array, int ibStart, int cbSize);
protected abstract void HashCore (byte[] array, int ibStart, int cbSize);
abstract member HashCore : byte[] * int * int -> unit
Protected MustOverride Sub HashCore (array As Byte(), ibStart As Integer, cbSize As Integer)

参数

array
Byte[]

要计算其哈希代码的输入。The input to compute the hash code for.

ibStart
Int32

字节数组中的偏移量,从该位置开始使用数据。The offset into the byte array from which to begin using data.

cbSize
Int32

字节数组中用作数据的字节数。The number of bytes in the byte array to use as data.

注解

应用程序代码不会调用此方法。This method is not called by application code.

此抽象方法执行哈希计算。This abstract method performs the hash computation. 每次写入加密哈希算法时,都会通过此方法传递数据。Every write to the cryptographic hash algorithm passes the data through this method. 对于每个数据块,此方法将更新哈希对象的状态,以便在数据的末尾返回正确的哈希值。For each block of data, this method updates the state of the hash object so a correct hash value is returned at the end of the data.

HashCore(ReadOnlySpan<Byte>)

将写入对象的数据路由到哈希算法以计算哈希值。Routes data written to the object into the hash algorithm for computing the hash.

protected:
 virtual void HashCore(ReadOnlySpan<System::Byte> source);
protected virtual void HashCore (ReadOnlySpan<byte> source);
abstract member HashCore : ReadOnlySpan<byte> -> unit
override this.HashCore : ReadOnlySpan<byte> -> unit
Protected Overridable Sub HashCore (source As ReadOnlySpan(Of Byte))

参数

source
ReadOnlySpan<Byte>

要计算其哈希代码的输入。The input to compute the hash code for.

注解

此方法的默认实现将 source 复制到临时数组并调用 HashCore(Byte[], Int32, Int32)The default implementation of this method copies source to a temporary array and calls HashCore(Byte[], Int32, Int32).

派生类型应重写此方法,以避免中间数据复制。Derived types should override this method to avoid the intermediate data copying.

适用于