XZ Utils  5.2.2
Functions | Variables
crc32_small.c File Reference

CRC32 calculation (size-optimized) More...

#include "check.h"

Functions

static void crc32_init (void)
 
void lzma_crc32_init (void)
 
uint32_t lzma_crc32 (const uint8_t *buf, size_t size, uint32_t crc)
 Calculate CRC32. More...
 

Variables

uint32_t lzma_crc32_table [1][256]
 

Detailed Description

CRC32 calculation (size-optimized)

Function Documentation

§ lzma_crc32()

uint32_t lzma_crc32 ( const uint8_t *  buf,
size_t  size,
uint32_t  crc 
)

Calculate CRC32.

Calculate CRC32 using the polynomial from the IEEE 802.3 standard.

Parameters
bufPointer to the input buffer
sizeSize of the input buffer
crcPreviously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when starting a new calculation.
Returns
Updated CRC value, which can be passed to this function again to continue CRC calculation.

Referenced by lzma_block_header_decode(), lzma_check_update(), and lzma_index_hash_decode().

Variable Documentation

§ lzma_crc32_table

uint32_t lzma_crc32_table[1][256]

lzma_crc32_table[0] is needed by LZ encoder so we need to keep the array two-dimensional.