Return Value
The adler32() function returns the
new checksum value.
Detailed
Description
The adler32() function computes a
running
Adler-32 checksum.
On entry, adler is the previous
value of the
checksum, and buf points to an
array of
len bytes of data, to be added to
this
checksum.
The adler32() function will return the new
checksum.
If buf
is NULL
(or Z_NULL
), adler32()
returns the initial checksum.
Examples
To compute Adler-32 checksum of 1234:
#include <stdio.h> #include <zlib.h>
void Adler( ) { unsigned char buffer[5]="1234"; unsigned int i=4; unsigned long j=0L; long adler_init = adler32(j,0, 0); long adler = adler32(adler_init, &buffer[0], i); printf("adler checksum value is %x",adler); }
|
Output
adler checksum value is 01f800cb.
|
Errors
None defined.
Feedback
For additional information or queries on this page send
feedback