{"id":22685123,"url":"https://github.com/kartikmehta8/rust-compression","last_synced_at":"2025-03-29T15:14:51.429Z","repository":{"id":264951189,"uuid":"808922933","full_name":"kartikmehta8/rust-compression","owner":"kartikmehta8","description":"This Rust program compresses a file using gzip compression. It takes two command line arguments: the source file and the destination file.","archived":false,"fork":false,"pushed_at":"2024-06-01T07:03:50.000Z","size":1,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T03:58:43.369Z","etag":null,"topics":["cli-app","gzip-compression","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kartikmehta8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-01T07:03:33.000Z","updated_at":"2024-06-01T07:07:47.000Z","dependencies_parsed_at":"2024-11-27T02:02:33.754Z","dependency_job_id":null,"html_url":"https://github.com/kartikmehta8/rust-compression","commit_stats":null,"previous_names":["kartikmehta8/rust-compression"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kartikmehta8%2Frust-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kartikmehta8","download_url":"https://codeload.github.com/kartikmehta8/rust-compression/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246200323,"owners_count":20739566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-app","gzip-compression","rust"],"created_at":"2024-12-09T22:13:15.537Z","updated_at":"2025-03-29T15:14:51.406Z","avatar_url":"https://github.com/kartikmehta8.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Gzip Compression Tool\n\nThis Rust program compresses a file using gzip compression. It takes two command line arguments: the source file and the destination file.\n\n## Usage\n\n```bash\ncargo run \u003csource\u003e \u003cdestination\u003e\n```\n\n## Example\n\n```bash\ncargo run input.txt output.gz\n```\n\n## Code\n\n```rust\nextern crate flate2;\n\nuse flate2::write::GzEncoder;\nuse flate2::Compression;\nuse std::env::args;\nuse std::fs::File;\nuse std::io::copy;\nuse std::io::BufReader;\nuse std::time::Instant;\n\nfn main() {\n    if args().len() != 3 {\n        eprintln!(\"Usage: {} \u003csource\u003e \u003cdestination\u003e\", args().nth(0).unwrap());\n        return;\n    }\n\n    let mut input = BufReader::new(File::open(args().nth(1).unwrap()).unwrap());\n    let output = File::create(args().nth(2).unwrap()).unwrap();\n    let mut encoder = GzEncoder::new(output, Compression::default());\n    let start = Instant::now();\n\n    copy(\u0026mut input, \u0026mut encoder).unwrap();\n\n    println!(\n        \"Compressed {} bytes in {} ms\",\n        input.get_ref().metadata().unwrap().len(),\n        start.elapsed().as_millis(),\n    );\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartikmehta8%2Frust-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkartikmehta8%2Frust-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkartikmehta8%2Frust-compression/lists"}