PACKAGE.md 1.7 KB

LZ4

LZ4 is a lossless compression algorithm, providing compression speed greater than 500 MB/s per core. It features an extremely fast decoder, with speed in multiple GB/s per core. LZ4 can work with Zstandard to allow both algorithms to compress data faster.

Features

  • Extremely fast compression (500+ MB/s per core)
  • Very fast decoder (multi-GB/s per core)
  • Lossless compression algorithm
  • Compatible with Zstandard
  • Streaming compression support
  • Frame format for integrity checking

Installed Programs

  • lz4 - Compresses or decompresses files using the LZ4 format
  • lz4c - Compresses files using the LZ4 format (link to lz4)
  • lz4cat - Lists the contents of a file compressed using the LZ4 format (link to lz4)
  • unlz4 - Decompresses files using the LZ4 format (link to lz4)

Installed Library

  • liblz4.so - The library implementing lossless data compression, using the LZ4 algorithm

Usage Examples

Basic Compression

# Compress a file
lz4 file.txt file.txt.lz4

# Decompress a file
lz4 -d file.txt.lz4 file.txt

Using with pipes

# Compress output of a command
tar -cf - /path/to/directory | lz4 > archive.tar.lz4

# Decompress to pipe
lz4 -d archive.tar.lz4 | tar -xf -

Using the library

The LZ4 library can be used in C/C++ applications to provide fast compression and decompression capabilities.

Performance

LZ4 is designed for speed-critical applications where compression ratio is secondary. It offers:

  • Compression speeds over 500 MB/s per core
  • Decompression speeds over 1 GB/s per core
  • Trade-off between compression speed and ratio

License

This package is distributed under the BSD 2-Clause License.