LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
juno_zip.c File Reference
#include "juno/crc/crc.h"
#include "crc/zip.h"
Include dependency graph for juno_zip.c:

Functions

uint32_t Juno_CrcZipUpdate (uint32_t iCrc, const void *pcData, size_t zDataSize)
 Update ZIP CRC (CRC-32) with new data.
 

Function Documentation

◆ Juno_CrcZipUpdate()

uint32_t Juno_CrcZipUpdate ( uint32_t  iCrc,
const void *  pcData,
size_t  zDataSize 
)

Update ZIP CRC (CRC-32) with new data.

Applies a final XOR (0xFFFFFFFF) to the computed value before returning when data is processed. If streaming across multiple chunks, undo the XOR on the returned value before using it as the next iCrc. When pcData is NULL or zDataSize is 0, the function returns 0 (no XOR is applied in that case).

Parameters
iCrcRunning CRC value (use JUNO_ZIP_CRC_INIT initially).
pcDataPointer to data buffer (can be NULL when zDataSize is 0).
zDataSizeSize of data buffer in bytes.
Returns
Updated CRC-32 value; returns 0 when pcData is NULL or zDataSize is 0.