110,571
社区成员
发帖
与我相关
我的任务
分享
//
// 摘要:
// 计算指定字节数组的哈希值。
//
// 参数:
// buffer:
// 要计算其哈希代码的输入。
//
// 返回结果:
// 计算所得的哈希代码。
//
// 异常:
// System.ArgumentNullException:
// buffer 为 null。
//
// System.ObjectDisposedException:
// 此对象已释放。
public byte[] ComputeHash(byte[] buffer);
public byte[] ComputeHash(byte[] buffer)
{
if (this.m_bDisposed)
{
throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic"));
}
if (buffer == null)
{
throw new ArgumentNullException("buffer");
}
this.HashCore(buffer, 0, buffer.Length);
this.HashValue = this.HashFinal();
byte[] buffer2 = (byte[]) this.HashValue.Clone();
this.Initialize();
return buffer2;
}