1.2 CRYPT_HUFFMAN_Compress Function
C
int CRYPT_HUFFMAN_Compress(
unsigned char* out,
unsigned int outSz,
const unsigned char* in,
unsigned int inSz,
unsigned int flags
);Description
This function compresses a block of data using Huffman encoding.
Preconditions
None.
Parameters
| Parameters | Description |
|---|---|
| out | Pointer to location to store the compressed data |
| outSz | Maximum size of the output data in bytes |
| in | Point to location of source data |
| inSz | Size of the input data in bytes |
| flags | Flags to control how compress operates |
Returns
- negative - Error code
- positive - Bytes stored in the out buffer
Remarks
Output buffer must be large enough to hold the contents of the operation.
Example
const unsigned char text[] = "..."; unsigned int inSz = sizeof(text); unsigned int outSz; unsigned char cBuffer[1024]; int ret; ret = CRYPT_HUFFMAN_COMPRESS(cBuffer, sizeof(cBuffer), text, inSz, 0);
