| QuickHash Library | API |
|
ADLER32 API Overview
ADLER32 API assists you in generating ADLER32 checksums.
ADLER32 checksums can be generated in two modes: accumulative and non-accumulative.
The accumulative mode is applied when the data for which the checksum is calculated (data) represents one or more continuous memory block(s) or when the data is created at runtime in many steps (for instance, when reading a file).
Non-accumulative mode can be applied when the data represents only one continuous memory block.
Note. When the data represents just one continuous memory block, both methods can be applied.
To generate the checksum in the accumulative mode, perform the following:
Allocate at least SLC_ADLER32_CONTEXTSIZE bytes for the context.
Call the SL_ADLER32_Init function to initialize the context.
Call the SL_ADLER32_Update function for each continuous memory block of data to perform the calculations.
Note. You can use SL_ADLER32_UpdateStr function (instead of SL_ADLER32_Update function) if the data represents a null-terminated string.
Call the SL_ADLER32_Final or the SL_ADLER32_FinalHex function to obtain the checksum.
Note. Call the SL_ADLER32_FinalHex function when you need to retrieve the hexadecimal string representation of the checksum.
To generate the checksum in the non-accumulative mode, perform the following:
Call the SL_ADLER32_Calculate or the SL_ADLER32_CalculateHex function to calculate and retrieve the checksum.
Note 1. Call the SL_ADLER32_CalculateHex function when you need to retrieve the hexadecimal string representation of the checksum.
Note 2. You can use SL_ADLER32_CalculateStr and SL_ADLER32_CalculateStrHex functions (instead of SL_ADLER32_Calculate and SL_ADLER32_CalculateHex functions) if the data represents a null-terminated string.
| #include <QuickHash.h> |
ADLER32 API Functions | Useful Links | HashCalc
Samples ADLER32 checksum generation for a file
ADLER32 checksum generation for a string
| Send Feedback to SlavaSoft Inc. | Tell a friend about QuickHash Library |