Skip to content

Files

Latest commit

 

History

History
17 lines (13 loc) · 856 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 856 Bytes

Libhuffman - huffman compression/decompression library

Features

  • Fast
  • Fixed-size result (5 bytes) for a special case where the input buffer is full of some constant byte

API

  1. uchar* huffman_compress (uchar *input, uint insize, uint* outsize) - compress the data, using huffman codes
  • input - input data
  • insize - size of input data
  • outsize - pointer to size of output data
  • returns: uchar* - pointer to memory where the compressed data is stored. Memory is allocated automatically (*outsize bytes). The uncompressed (original) data size is stored in first 4 bytes of the output buffer
  1. uchar* huffman_decompress (uchar *input) - decompress the data, using huffman codes
  • input - input data (compressed)
  • returns: uchar - pointer to memory where decompressed data is stored. Memory is allocated automatically