{"id":13580602,"url":"https://github.com/gyscos/zstd-rs","last_synced_at":"2025-05-13T18:13:46.719Z","repository":{"id":4200526,"uuid":"52115335","full_name":"gyscos/zstd-rs","owner":"gyscos","description":"A rust binding for the zstd compression library.","archived":false,"fork":false,"pushed_at":"2025-03-20T14:48:02.000Z","size":935,"stargazers_count":562,"open_issues_count":74,"forks_count":119,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-10T00:08:12.574Z","etag":null,"topics":["compression","rust-bindings","wrapper","zstd"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gyscos.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2016-02-19T20:44:03.000Z","updated_at":"2025-05-05T12:03:46.000Z","dependencies_parsed_at":"2023-10-10T17:55:20.510Z","dependency_job_id":"5eaa4fcd-cdcb-4f46-9606-ba9f81aa1b47","html_url":"https://github.com/gyscos/zstd-rs","commit_stats":{"total_commits":497,"total_committers":58,"mean_commits":8.568965517241379,"dds":"0.23541247484909456","last_synced_commit":"bfe1e34f593c2427e9dc35f1b98d06788174711f"},"previous_names":[],"tags_count":89,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyscos%2Fzstd-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyscos%2Fzstd-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyscos%2Fzstd-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gyscos%2Fzstd-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gyscos","download_url":"https://codeload.github.com/gyscos/zstd-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253418848,"owners_count":21905329,"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-bindings","wrapper","zstd"],"created_at":"2024-08-01T15:01:53.486Z","updated_at":"2025-05-13T18:13:46.671Z","avatar_url":"https://github.com/gyscos.png","language":"Rust","funding_links":[],"categories":["Rust","Libraries","others"],"sub_categories":["Compression"],"readme":"# zstd\n\n[![crates.io](https://img.shields.io/crates/v/zstd.svg)](https://crates.io/crates/zstd)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)\n\n[![Build on Linux](https://github.com/gyscos/zstd-rs/actions/workflows/linux.yml/badge.svg)](https://github.com/gyscos/zstd-rs/actions/workflows/linux.yml)\n[![Build on Windows](https://github.com/gyscos/zstd-rs/actions/workflows/windows.yml/badge.svg)](https://github.com/gyscos/zstd-rs/actions/workflows/windows.yml)\n[![Build on macOS](https://github.com/gyscos/zstd-rs/actions/workflows/macos.yml/badge.svg)](https://github.com/gyscos/zstd-rs/actions/workflows/macos.yml)\n[![Build on wasm](https://github.com/gyscos/zstd-rs/actions/workflows/wasm.yml/badge.svg)](https://github.com/gyscos/zstd-rs/actions/workflows/wasm.yml)\n\n\nThis library is a rust binding for the [zstd compression library][zstd].\n\n# [Documentation][doc]\n\n## 1 - Add to `cargo.toml`\n\n```bash\n$ cargo add zstd\n```\n\n```toml\n# Cargo.toml\n\n[dependencies]\nzstd = \"0.13\"\n```\n\n## 2 - Usage\n\nThis library provides `Read` and `Write` wrappers to handle (de)compression,\nalong with convenience functions to made common tasks easier.\n\nFor instance, `stream::copy_encode` and `stream::copy_decode` are easy-to-use\nwrappers around `std::io::copy`. Check the [stream] example:\n\n```rust\nuse std::io;\n\n// This function use the convenient `copy_encode` method\nfn compress(level: i32) {\n    zstd::stream::copy_encode(io::stdin(), io::stdout(), level).unwrap();\n}\n\n// This function does the same thing, directly using an `Encoder`:\nfn compress_manually(level: i32) {\n    let mut encoder = zstd::stream::Encoder::new(io::stdout(), level).unwrap();\n    io::copy(\u0026mut io::stdin(), \u0026mut encoder).unwrap();\n    encoder.finish().unwrap();\n}\n\nfn decompress() {\n    zstd::stream::copy_decode(io::stdin(), io::stdout()).unwrap();\n}\n```\n\n# Asynchronous support\n\nThe [`async-compression`](https://github.com/Nemo157/async-compression/) crate\nprovides an async-ready integration of various compression algorithms,\nincluding `zstd-rs`.\n\n# Compile it yourself\n\n`zstd` is included as a submodule. To get everything during your clone, use:\n\n```\ngit clone https://github.com/gyscos/zstd-rs --recursive\n```\n\nOr, if you cloned it without the `--recursive` flag,\ncall this from inside the repository:\n\n```\ngit submodule update --init\n```\n\nThen, running `cargo build` should take care\nof building the C library and linking to it.\n\n# Build-time bindgen\n\nThis library includes a pre-generated `bindings.rs` file.\nYou can also generate new bindings at build-time, using the `bindgen` feature:\n\n```\ncargo build --features bindgen\n```\n\n# TODO\n\n* Benchmarks, optimizations, ...\n\n# Disclaimer\n\nThis implementation is largely inspired by bozaro's [lz4-rs].\n\n# License\n\n* The zstd C library is under a dual BSD/GPLv2 license.\n* This zstd-rs binding library is under a [MIT](LICENSE) license.\n\n[zstd]: https://github.com/facebook/zstd\n[lz4-rs]: https://github.com/bozaro/lz4-rs\n[cargo-edit]: https://github.com/killercup/cargo-edit#cargo-add\n[doc]: https://docs.rs/zstd\n[stream]: examples/stream.rs\n[submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyscos%2Fzstd-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgyscos%2Fzstd-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgyscos%2Fzstd-rs/lists"}