sile / libflate

A Rust implementation of DEFLATE algorithm and related formats (ZLIB, GZIP)
https://docs.rs/libflate
MIT License
178 stars 35 forks source link

LZ77 compressor as a separate crate? #46

Closed HybridEidolon closed 4 years ago

HybridEidolon commented 4 years ago

I am working on a crate which implements a compressor and decompressor for a particular encoding of LZ77 used in several video games for asset compression. The LZ77 compressor in this crate is perfect for my needs, but I can't import it in isolation from the rest of the DEFLATE and gzip implementation, so the crate has to pull in dependencies it doesn't really need.

Would you consider making the LZ77 encoder a separate crate to make this sort of use case easier?

sile commented 4 years ago

Hi, thank you for creating this issue. It is possible to simply separate the LZ77 part of this crate into another crate, such as libflate_lz77 (the current LZ77 implementation is very naive and not optimal, though). Is it sufficient for you?

HybridEidolon commented 4 years ago

Sure. My crate currently clone-and-owns the lz77 module and makes some minor adjustments to make it compatible with the lz77 implementation I am working with, and it works perfectly, although the compression ratio admittedly isn't the best.

sile commented 4 years ago

Published https://crates.io/crates/libflate_lz77.