A Rust library for LZW data compression and decompression.
This Rust library provides a simple and efficient implementation of the LZW data compression algorithm. LZW is a widely used compression algorithm that can be used to reduce the size of data for storage or transmission.
To use this library in your Rust project, add it as a dependency in your Cargo.toml
file:
toml
[dependencies]
lzw-compression = "0.1.0"
Or call cargo add lzw-compression
To compress data using the LZW algorithm, you can use the compress
function provided by the library. Here's an example of how to use it:
```rust use lzw_compression::compress;
let data = vec![1, 2, 3, 4, 1, 2, 3, 5]; let compresseddata = compress(&data); println!("Compressed data: {:?}", compresseddata);
use lzw_compression::decompress;
let compresseddata = vec![1, 2, 3, 4, 1, 2, 3, 5]; let decompresseddata = decompress(&compresseddata); println!("Decompressed data: {:?}", decompresseddata); ```
This library is licensed under the MIT License.