|
ZLIB
|
Compute the Adler-32 checksum of a data stream. More...
#include "zutil.h"Functions | |
| uLong ZEXPORT | adler32_z (uLong adler, const Bytef *buf, z_size_t len) |
| Same as adler32(), but with a size_t length. | |
| uLong ZEXPORT | adler32 (uLong adler, const Bytef *buf, uInt len) |
| Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. | |
| local uLong | adler32_combine_ (uLong adler1, uLong adler2, z_off64_t len2) |
| Combine two Adler-32 checksums into one. | |
| uLong ZEXPORT | adler32_combine (uLong adler1, uLong adler2, z_off_t len2) |
| uLong ZEXPORT | adler32_combine64 (uLong adler1, uLong adler2, z_off64_t len2) |
Compute the Adler-32 checksum of a data stream.
Copyright (C) 1995-2011, 2016 Mark Adler For conditions of distribution and use, see copyright notice in zlib.h
| uLong ZEXPORT adler32 | ( | uLong | adler, |
| const Bytef * | buf, | ||
| uInt | len | ||
| ) |
Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum.
An Adler-32 value is in the range of a 32-bit unsigned integer. If buf is Z_NULL, this function returns the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster.
Usage example:
| local uLong adler32_combine_ | ( | uLong | adler1, |
| uLong | adler2, | ||
| z_off64_t | len2 | ||
| ) |
Combine two Adler-32 checksums into one.
For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
Note that the z_off_t type (like off_t) is a signed integer. If len2 is negative, the result has no meaning or utility.