Skip to content

A 7z decompressor/compressor lib written in pure rust.

License

Notifications You must be signed in to change notification settings

hzsong123/sevenz-rust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crate Documentation

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

Decompression

Supported codecs:

  • BZIP2 (require feature 'bzip2')
  • COPY
  • LZMA
  • LZMA2
  • ZSTD (require feature 'zstd')

Supported filters:

  • BCJ X86
  • BCJ PPC
  • BCJ IA64
  • BCJ ARM
  • BCJ ARM_THUMB
  • BCJ SPARC
  • DELTA

Usage

[dependencies]
sevenz-rust={version="0.2.9"}

Decompress source file "data/sample.7z" to dest path "data/sample"

sevenz_rust::decompress_file("data/sample.7z", "data/sample").expect("complete");

Decompress a encrypted 7z file

Add 'aes256' feature

[dependencies]
sevenz-rust={version="0.1.5", features=["aes256"]}
sevenz_rust::decompress_file_with_password("path/to/encrypted.7z", "path/to/output", "password".into()).expect("complete");

Compression

Currently only support LZMA2 method.

[dependencies]
sevenz-rust={version="0.2", features=["compress"]}

Use the helper function to create a 7z file with source path.

sevenz_rust::compress_to_path("examples/data/sample", "examples/data/sample.7z").expect("compress ok");

About

A 7z decompressor/compressor lib written in pure rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%