| Crates.io | zipoxide |
| lib.rs | zipoxide |
| version | 0.1.0 |
| created_at | 2025-09-07 15:17:54.222053+00 |
| updated_at | 2025-09-07 15:17:54.222053+00 |
| description | A Rust-powered, blazing fast ZIP utility. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1828245 |
| size | 56,336 |
A Rust-powered, blazing fast ZIP utility. Leverages memory-mapped I/O and parallelism to read, create, and extract ZIP archives efficiently.
HashMap<String, Vec<u8>>), including password-protected archives.Add zipoxide to your Cargo.toml:
[dependencies]
zipoxide = "0.1"
Then build your project:
cargo build
use zipoxide::read_zip_contents_into_buffer;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Unencrypted ZIP
let contents = read_zip_contents_into_buffer("archive.zip".to_string(), None)?;
// Password-protected ZIP
let protected_contents = read_zip_contents_into_buffer(
"secret.zip".to_string(),
Some("hunter2".to_string()),
)?;
for (name, data) in protected_contents {
println!("File: {}, Size: {} bytes", name, data.len());
}
Ok(())
}
HashMap<String, Vec<u8>> where key = file name, value = file bytes.use zipoxide::create_zip_from_folder;
use zip::write::FileOptions;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let options = FileOptions::default();
create_zip_from_folder(
"archive.zip".to_string(),
"my_folder".to_string(),
options,
)?;
Ok(())
}
FileOptions::encrypt_with(password).use zipoxide::create_zip_from_files;
use zip::write::FileOptions;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let options = FileOptions::default();
create_zip_from_files(
"files_archive.zip".to_string(),
vec!["file1.txt".to_string(), "dir1".to_string()],
options,
)?;
Ok(())
}
FileOptions.use zipoxide::extract_zip;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Unencrypted extraction
extract_zip(
"archive.zip".to_string(),
"output_dir".to_string(),
None,
)?;
// Password-protected extraction
extract_zip(
"secret.zip".to_string(),
"output_dir_secure".to_string(),
Some("hunter2".to_string()),
)?;
Ok(())
}
Arc<Mutex<...>> ensures safe parallel writes to in-memory structures.MIT License © [Rashikraj Shrestha]