{"id":13828777,"url":"https://github.com/bearcove/rc-zip","last_synced_at":"2025-04-07T17:04:11.134Z","repository":{"id":48075193,"uuid":"195963495","full_name":"bearcove/rc-zip","owner":"bearcove","description":"ZIP format implementation in Rust, sans-io","archived":false,"fork":false,"pushed_at":"2024-10-08T17:06:18.000Z","size":675,"stargazers_count":271,"open_issues_count":2,"forks_count":25,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-10-29T07:02:56.882Z","etag":null,"topics":["compression","rust","zip"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bearcove.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":["fasterthanlime"]}},"created_at":"2019-07-09T08:12:07.000Z","updated_at":"2024-10-22T11:23:56.000Z","dependencies_parsed_at":"2024-10-29T07:03:06.096Z","dependency_job_id":"97a7a911-2dce-4c1e-8579-d465ce654a58","html_url":"https://github.com/bearcove/rc-zip","commit_stats":null,"previous_names":["fasterthanlime/rc-zip","rust-compress/rc-zip"],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Frc-zip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Frc-zip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Frc-zip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bearcove%2Frc-zip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bearcove","download_url":"https://codeload.github.com/bearcove/rc-zip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247196027,"owners_count":20899803,"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":["compression","rust","zip"],"created_at":"2024-08-04T09:03:08.483Z","updated_at":"2025-04-07T17:04:11.116Z","avatar_url":"https://github.com/bearcove.png","language":"Rust","funding_links":["https://github.com/sponsors/fasterthanlime"],"categories":["Rust"],"sub_categories":[],"readme":"[![MIT OR Apache-2.0 licensed](https://img.shields.io/badge/license-MIT+Apache_2.0-blue.svg)](./LICENSE)\n[![Crates.io](https://img.shields.io/crates/v/rc-zip)](https://crates.io/crates/rc-zip)\n[![docs.rs](https://docs.rs/rc-zip/badge.svg)](https://docs.rs/rc-zip)\n\n# rc-zip\n\n![The rc-zip logo: a person with long hair and nice brows being opened from the bottom up with a zipper. On dark backgrounds, you can see a skull being revealed. On light backgrounds you cannot.](https://github.com/user-attachments/assets/5fecd286-9518-4a72-b544-56675d7f31f6)\n\n_Logo by [MisiasArt](https://misiasart.com)_\n\n### Motivation\n\nHave a pure rust, highly compatible, I/O-model-independent, zip reading and\nwriting library.\n\n(Note: as of now, rc-zip does reading only)\n\n### Funding\n\nThanks to these companies for contracting work on rc-zip:\n\n\u003ca href=\"https://rowzero.io\"\u003e\u003cimg src=\"./static/rowzero-e.svg\" height=\"40\"\u003e\u003c/a\u003e\n\nAnd thanks to all my [individual sponsors](https://fasterthanli.me/donate).\n\n### Design decisions\n\nThe core of this crate does not perform I/O directly. Instead, it uses a state\nmachine, and asks for reads at specific offsets. This allows it to work under\ndifferent I/O models: blocking, non-blocking, and async. It has no expectations\nof the zip archive being present on disk (ie. it doesn't assume `std::fs`), just\nthat random access is possible.\n\nThe recommended interface relies on the central directory rather than local headers:\n\n```\n[local file header 1] // \u003c---------------- ignored\n[file data 1]\n[local file header 2]\n[file data 2]\n[central directory header 1] // \u003c--------- used\n[central directory header 2]\n[end of central directory record]\n```\n\nThe reason for that is that the central directory is the canonical list of\nentries in a zip. Archives that have been repacked may contain duplicate local\nfile headers (and data), along with headers for entries that have been removed.\nOnly the central directory is authoritative when it comes to the contents of a\nzip archive.\n\nHowever, as of v4.0.0, a streaming decompression interface was added to both\n`rc-zip-sync` and `rc-zip-tokio`, in the form of the `ReadZipStreaming` traits.\n\nThis crate accepts what is known as \"trailing zips\" - for example, files that\nare valid ELF or PE executables, and merely have a valid zip archive appended.\nThis covers some forms of self-extracting archives and installers.\n\nThis crate recognizes and uses zip64 metadata. This allows for a large number\nof entries (above 65536) and large entries (above 4GiB). This crate attempts to\nforgives some non-standard behavior from common tools. Such behavior has been\nobserved in the wild and is, whenever possible, tested.\n\nThis crate attempts to recognize as much metadata as possible, and normalize\nit. For example, MSDOS timestamps, NTFS timestamps, Extended timestamps and\nUnix timestamps are supported, and they're all converted to a [chrono\nDateTime\u003cUtc\u003e](https://crates.io/crates/chrono).\n\nAlthough the normalized version of metadata (names, timestamps, UID, GID, etc.)\nis put front and center, this crate attempts to expose a \"raw\" version of\nthat same metadata whenever the authors felt it was necessary.\n\nWhenever the zip archive doesn't explicitly specify UTF-8 encoding, this crate\nrelies on encoding detection to decide between CP-437 and Shift-JIS. It uses\n[encoding_rs](https://crates.io/crates/encoding_rs) to deal with Shift-JIS.\n\nDue to the history of the zip format, some compatibility issues are to be\nexpected: for example, for archives with only MSDOS timestamps, the results\nmight be in the wrong timezone. For archive with very few files and non-UTF8\nnames, the encoding might not be detected properly, and thus decoding may fail.\n\nAs much as possible, [winnow](https://crates.io/crates/winnow) is used to parse the\nvarious data structures used in the zip archive format. This allows a\nsemi-declarative style that is easier to write, read, and amend if needed.\nSome (hygienic) macros are used to avoid repetition.\n\n### API design\n\nThe design of the API is constrained by several parameters:\n\n  * A compliant zip reader *must* first read the central directory, located\n  near the end of the zip archive. This means simply taking an `Read` won't do.\n  * Multiple I/O models must be supported. Whereas other crates focus on\n  taking a `Read`, a `Read + Seek`, or simply a byte slice, this crate aims\n  to support synchronous *and* asynchronous I/O.\n  * Not everyone wants a compliant zip reader. Some may want to rely on local\n  headers instead, completely ignoring the central directory, thus throwing\n  caution to the wind.\n\nAs a result, the structs in this crate are state machines, that advertise their\nneed to read (and from where), to process data, or to write. I/O errors are\ncleanly separated from the rest, and calls to this crate never block.\n\nSeparate crates add specific I/O models on top of rc-zip, see the [rc-zip-sync](https://crates.io/crates/rc-zip-sync)\nand [rc-zip-tokio](https://crates.io/crates/rc-zip-tokio) crates.\n\n## License\n\nThis project is primarily distributed under the terms of both the MIT license\nand the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Frc-zip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbearcove%2Frc-zip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbearcove%2Frc-zip/lists"}