rust-lzxpress
[MS-XCA]: Xpress Compression Algorithm
Introduction
The Xpress Compression Algorithm has three variants, all designed for speed. The fastest variant, Plain LZ77, implements the LZ77 algorithm (UASDC). A slower variant, LZ77+Huffman, adds a Huffman encoding pass on the LZ77 data. A third variant, LZNT1, implements LZ77 without the Huffman encoding pass of the second variant, but with an encoding process less complex than Plain LZ77.
Overview
This algorithm efficiently compresses data that contain repeated byte sequences. It is not designed to compress image, audio, or video data. Between the trade-offs of compressed size and CPU cost, it heavily emphasizes low CPU cost.
Relationship to Protocols and Other Algorithms
This algorithm does not depend on any other algorithms or protocols. It is a compression method designed to have minimal CPU overhead for compression and decompression. A protocol that depends on this algorithm would typically need to transfer significant amounts of data that cannot be easily precompressed by another algorithm having a better compression ratio.
Applicability Statement
This algorithm is appropriate for any protocol that transfers large amounts of easily compressible textlike data, such as HTML, source code, or log files. Protocols use this algorithm to reduce the number of bits transferred.
This library
This crate provides a simple interface to Microsoft Xpress compression algorithm. Microsoft Xpress Compression Algorith is more commonly known as LZXpress. This algorithm efficiently compresses data that contain repeated byte sequences. It is not designed to compress image, audio, or video data. Between the trade-offs of compressed size and CPU cost, it heavily emphasizes low CPU cost. It is mainly used by Microsoft features or protocols such as Microsoft Windows hibernation file, Microsoft SMB protocol or even Microsoft Windows 10 compressed memory management.
decompress
/compress
are an easy to use functions for simple use cases.
Example
Cargo.toml:
[]
= "0.1.0"
main.rs:
extern crate lzxpress;
use lzxpress;
const TEST_STRING: &'static str = "this is a test. and this is a test too";
const TEST_DATA: &'static = &;