Skip navigation.
 
mlInteresting issue with adler32 algorithm...
FROM : Matthew Lehrian
DATE : Sun Jan 26 23:13:04 2003

I have code originally written in Java which I'm porting to Obj-C.

In Java, I'm using  java.util.zip.Adler32.
In Obj-C, I'm using  ZEXTERN uLong ZEXPORT adler32 OF((uLong adler,
const Bytef *buf, uInt len));  from /usr/include/zlib.h.

With the same input, they return different outputs.  Any idea why?

For example, using "FIELD1FIELD2" as input, I get the following results:

Java Adler32:        353305388
Obj-C Adler32:        352518955


I also compute CRC32 checksums of the same data with the equivalent
tools in for each language and they produce identical results (i.e. -
the CRC32 checksum calculated in java matches the one calculated with
Obj-C.  Here are the CRC32 checksums for the "FIELD1FIELD2" input data
(correct):

Java CRC32:        4010965360
Obj-C CRC32:        4010965360

Thanks for your help!
Matthew

Related mailsAuthorDate
No related mails found.