AniDBmini.HashAlgorithms.Ed2k.HashCore C# (CSharp) Method

HashCore() protected method

protected HashCore ( byte b, int offset, int length ) : void
b byte
offset int
length int
return void
        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;
                }
            }
        }