protected override void HashCore(byte[] b, int offset, int length) { while (length != 0) { totalBytesRead += length; if (length < missing) { md4.TransformBlock(b, offset, length, null, 0); missing -= length; length = 0; if (missing % (5120 * 512) == 0) { FileHashingProgress(this, new FileHashingProgressArgs(totalBytesRead, size)); } } else { md4.TransformFinalBlock(b, offset, missing); md4HashBlocks.Add(md4.Hash); md4.Initialize(); length -= missing; offset += missing; missing = BLOCKSIZE; } } }
public Ed2k() { md4HashBlocks = new List <byte[]>(); md4 = new Md4(); nullMd4Hash = md4.ComputeHash(nullArray); md4.Initialize(); }
public Ed2k() { md4HashBlocks = new List<byte[]>(); md4 = new Md4(); nullMd4Hash = md4.ComputeHash(nullArray); md4.Initialize(); }