Please note the following legal notice. This function is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm Calculate the MD5 digest for the supplied file

Return TypeFunction nameArguments
hzEcodehzMD5::CalcMD5(hzChain&,)

Declared in file: hzCodec.h
Defined in file : hzCodec.cpp

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:Return E_NODATA 5:zi nBytes buf 6:unknown 7:nBytes 8:unknown 9:zi items 10:items []buf 11:Return E_OK

Function body:

hzEcode hzMD5::CalcMD5 (hzChain& Z)
{
   //  Category: Codec
   //  
   //  Please note the following legal notice. This function is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm
   //  
   //  Calculate the MD5 digest for the supplied file
   //  
   //  Arguments: 1) filepath The file to be hashed
   //  
   //  Returns: E_NODATA If the input chain is empty
   //     E_OK  If this MD5 value is calculated
   _hzfunc("hzMD5::CalcMD5(hzChain)") ;
   _md5_unit   md5Unit ;       //  MD5 encoding unit
   chIter      zi ;            //  Input chain iterator
   uchar*      buf ;           //  Working data buffer
   uint32_t    nBytes ;        //  No of bytes extracted from input chain
   if (!this)
       hzexit(E_CORRUPT, "No instance") ;
   if (!Z.Size())
       return E_NODATA ;
   zi = Z ;
   //  s = nil ;
   nBytes = 0;
   buf = new uchar[8196];
   for (;;)
   {
       nBytes = zi.Write(buf, 4096);
       if (!nBytes)
           break ;
       zi += nBytes ;
       _xlate_md5(buf, nBytes, 0,md5Unit) ;
   }
   _xlate_md5(buf, nBytes, (uchar*) m_Parts, md5Unit) ;
   delete [] buf ;
   return E_OK ;
}