Return TypeFunction nameArguments
hzEcodehzMD5::CalcMD5File(const char*,)

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

Function Logic:

0:START 1:OpenInputStrm rc 2:rc!=E_OK 3:Return rc 4:n workBuf 5:; 6:ifstream::read ifstream::gcount 7:!is.gcount() 8:ifstream::gcount n 9:n&0x3f 10:_xlate_md5 n 11:_xlate_md5 []workBuf close 12:Return E_OK

Function body:

hzEcode hzMD5::CalcMD5File (const char* filepath)
{
   _hzfunc("hzMD5::CalcMD5(file)") ;
   ifstream    is ;
   _md5_unit   md5Unit ;
   uchar*      workBuf ;
   int32_t     n ;
   hzEcode     rc ;
   rc = OpenInputStrm(is, filepath) ;
   if (rc != E_OK)
       return rc ;
   n = 0;
   workBuf = new uchar[8196];
   for (;;)
   {
       is.read((char*) (workBuf + n), 4096);
       if (!is.gcount())
           break ;
       n += is.gcount() ;
       if (n & 0x3f)
           continue ;
       _xlate_md5(workBuf, n, 0,md5Unit) ;
       n = 0;
   }
   _xlate_md5(workBuf, n, (uchar*) m_Parts, md5Unit) ;
   delete [] workBuf ;
   is.close()  ;
   return E_OK ;
}