public byte[] Hash(params HashDataProvider[] dataProviders)
{
_hashAlgorithm.Initialize ();
byte[] internalBuffer = new byte[1024 * 4];
foreach (HashDataProvider dataProvider in dataProviders) {
int bufferLength;
do {
bufferLength = dataProvider.NextBytes (internalBuffer);
if (bufferLength > 0)
_hashAlgorithm.TransformBlock (internalBuffer, 0, bufferLength, internalBuffer, 0);
} while (bufferLength > 0);
}
_hashAlgorithm.TransformFinalBlock (internalBuffer, 0, 0);
return _hashAlgorithm.Hash;
}
HashProvider::Hash ( byte buffer, int index ) : void |
public bool CompareTo(params HashDataProvider[] hashDataProviders) { HashProvider hasher = new HashProvider (_hashAlgo); byte[] localHash = hasher.Hash (hashDataProviders); return ByteHelper.CompareByteArrays (_digest, localHash); }