src/liblzma/common/vli_size.c File Reference

Calculates the encoded size of a variable-length integer. More...

#include "common.h"

Functions

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


Detailed Description

Calculates the encoded size of a variable-length integer.


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_VLI_BYTES_MAX, and LZMA_VLI_MAX.


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