This project is a 7z compressor/decompressor written in pure Rust.
And it's very much inspired by the apache commons-compress project.
The LZMA/LZMA2 decoder and all filters code was ported from tukaani xz for java
This is a fork of the original, unmaintained sevenz-rust crate to continue the development and maintenance.
Decompression
Supported codecs:
- BZIP2 (requires feature 'bzip2')
- COPY
- LZMA
- LZMA2
- ZSTD (requires feature 'zstd')
Supported filters:
- BCJ X86
- BCJ PPC
- BCJ IA64
- BCJ ARM
- BCJ ARM_THUMB
- BCJ SPARC
- DELTA
- BJC2
Usage
[]
= { = "0.7" }
Decompress source file "data/sample.7z" to destination path "data/sample":
decompress_file.expect;
Decompress an encrypted 7z file
Add the 'aes256' feature:
[]
= { = "0.7", = ["aes256"] }
decompress_file_with_password.expect;
Multi-thread decompress
Please check examples/mt_decompress
Compression
Currently, this crate only supports the LZMA2 compression algorithm.
[]
= { = "0.7", = ["compress"] }
Use the helper function to create a 7z file with source path:
compress_to_path.expect;
With AES encryption
[]
= { = "0.7", = ["compress", "aes256"] }
Use the helper function to create a 7z file with source path and password:
compress_to_path_encrypted.expect;
Advance
[]
= { = "0.7", = ["compress", "aes256"] }
Solid compression
use *;
let mut sz = create.expect;
sz.push_source_path.expect;
sz.finish.expect;
Compression methods
With encryption and lzma2 options:
use *;
let mut sz = create.expect;
sz.set_content_methods;
sz.push_source_path.expect;
sz.finish.expect;
Licence
Licensed under the Apache License, Version 2.0.