src/liblzma/check/crc32_small.c File Reference

CRC32 calculation (size-optimized). More...

#include "check.h"

Functions

static void crc32_init (void)
 LZMA_API (uint32_t)
 Get the size of the Check field with the given Check ID.

Variables

uint32_t lzma_crc32_table [1][256]


Detailed Description

CRC32 calculation (size-optimized).


Function Documentation

LZMA_API ( uint32_t   ) 

Get the size of the Check field with the given Check ID.

Get the number of bytes required to encode a VLI.

liblzma version number as an integer

Calculate CRC32.

Although not all Check IDs have a check algorithm associated, the size of every Check is already frozen. This function returns the size (in bytes) of the Check field with the specified Check ID. The values are: { 0, 4, 4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64, 64 }

If the argument is not in the range [0, 15], UINT32_MAX is returned.

Calculates CRC32 using the polynomial from the IEEE 802.3 standard.

Parameters:
buf Pointer to the input buffer
size Size of the input buffer
crc Previously returned CRC value. This is used to calculate the CRC of a big buffer in smaller chunks. Set to zero when there is no previous value.
Returns:
Updated CRC value, which can be passed to this function again to continue CRC calculation.

References lzma_crc32_table.


Variable Documentation

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.

Referenced by LZMA_API().


Generated on Wed May 25 10:35:38 2011 for XZ Utils by  doxygen 1.5.5