Thanks for the reply. yes I know I could do the CRC myself, but I'm
tryng to avoid adding that level of complexity to both my application
and the server app. The main issue is changing how I get the updated
file from the server (it will need to pass a CRC to me - which isn't the
end of the world but I know getting the plp writing the server to add
this will be a fight...).
Besides - the '.gz' file has a CRC within it. Why wouldn't 'libz' give
you access to that existing CRC value? 'gunzip' uses it, or uses some
information to verify the files integrity.
> Zlib API is designed to be a compression API, not a full package....
> However a CRC is not that difficult to implement yourself, and I don't
> know about you, **I** feel safer when I know what CRC was used. I
> generally use two different CRC methods when I am truly worried about
> data corruption. The standard CRC-32 polynomial you will find source
> code for on the internet, plus a checksum-sum (16-bit check sum, and
> 16-bit sum of the sum). If you want to go REALLY far, you can apply a
> 32-bit CRC to the compressed data form to check BEFORE you de-compress
> it and 32-bit CRC to check after, as much as you truly want to check,
> but Zlib doesn't do it for you, you must do it yourself.
> Just me,
> > I'm in the midst's of writing a program that can be updated via the
> > internet. The program will download gzip'd versions of shared
> > it uses. I found 'zlib' and have been using the file operation
> > (gzopen, gzread) to decompress the file.
> > However; there doesn't appear to be any API in zlib to determine the
> > original CRC of the '.gz' file. Additionally if the '.gz' file is
> > corrupted performing a gzopen, gzread will not cause any problems
> > least they return success values).
> > The question is, while using zlib how can I determine if the '.gz'
> > is not corrupted?
> > Thanks
> > -Jim
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Sent via Deja.com http://www.deja.com/
Before you buy.