{"id":16346380,"url":"https://github.com/milesgranger/isal-rs","last_synced_at":"2025-10-26T02:30:24.306Z","repository":{"id":116638895,"uuid":"514322852","full_name":"milesgranger/isal-rs","owner":"milesgranger","description":"Rust bindings to Intelligent Storage Acceleration Library (ISA-L)","archived":false,"fork":false,"pushed_at":"2024-10-22T05:48:17.000Z","size":70561,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-13T14:55:01.199Z","etag":null,"topics":["compression","gzip","igzip","isa-l","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milesgranger.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}},"created_at":"2022-07-15T15:44:11.000Z","updated_at":"2024-11-08T17:18:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e04f4a6-9e64-4dd3-835d-c4601c54a8bd","html_url":"https://github.com/milesgranger/isal-rs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesgranger%2Fisal-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesgranger%2Fisal-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesgranger%2Fisal-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesgranger%2Fisal-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesgranger","download_url":"https://codeload.github.com/milesgranger/isal-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236518717,"owners_count":19162119,"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","gzip","igzip","isa-l","rust"],"created_at":"2024-10-11T00:35:13.674Z","updated_at":"2025-10-26T02:30:20.435Z","avatar_url":"https://github.com/milesgranger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# isal-rs\n\n[![CI](https://github.com/milesgranger/isal-rs/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/milesgranger/isal-rs/actions/workflows/CI.yml)\n[![Latest version](https://img.shields.io/crates/v/isal-rs.svg)](https://crates.io/crates/isal-rs)\n[![Documentation](https://docs.rs/isal-rs/badge.svg)](https://docs.rs/isal-rs)\n![License](https://img.shields.io/crates/l/isal-rs.svg)\n\nRust bindings for [isa-l](https://github.com/intel/isa-l)\n\n---\n\nSupports the following codecs using the ISA-L library under the hood:\n\n- GZIP \n  - `isal::read::GzipEncoder/GzipDecoder`\n  - `isal::write::GzipEncoder/GzipDecoder`\n- DEFLATE\n  - `isal::read::DeflateEncoder/DeflateDecoder`\n  - `isal::write::DeflateEncoder/DeflateDecoder`\n- ZLIB\n  - `isal::read::ZlibEncoder/ZlibDecoder`\n  - `isal::write::ZlibEncoder/ZlibDecoder`\n\nOr can use functions of `de/compress` and `de/compress_into`\n\n---\n\nBuilding requires some system tools like `autotools`, `nasm`, `make`, and anything the official ISA-L repo suggests. \nOn Windows the build is invoked with `nmake`, other systems use the `./autogen.sh` and `./configure` setups.\n\n---\n\n### Examples:\n\n#### Functions like `compress_into` and `decompress`\n(Similar functionality with `compress` and `decompress_into`)\n```rust\nuse isal::{CompressionLevel, Codec, compress_into, decompress};\n\nlet mut compressed = vec![0u8; 100];\nlet nbytes = compress_into(b\"foobar\", \u0026mut compressed, CompressionLevel::Three, Codec::Gzip).unwrap();\n\nlet decompressed = decompress(\u0026compressed[..nbytes], Codec::Gzip).unwrap();\nassert_eq!(decompressed.as_slice(), b\"foobar\");\n```\n\n#### Compress using the Encoder/Decoder structs implementing `io::Read`\n\n```rust\nuse std::{io, io::Read};\nuse isal::{read::{Encoder, GzipEncoder}, CompressionLevel, decompress, Codec};\n\nlet data = b\"Hello, World!\".to_vec();\n\n// Note these two encoders are equivelent...\nlet mut encoder = GzipEncoder::new(data.as_slice(), CompressionLevel::Three);\nlet mut encoder = Encoder::new(data.as_slice(), CompressionLevel::Three, Codec::Gzip);\n\n// Number of compressed bytes written to `output`\nlet mut compressed = vec![];\nlet n = io::copy(\u0026mut encoder, \u0026mut compressed).unwrap();\nassert_eq!(n as usize, compressed.len());\n\nlet decompressed = decompress(compressed.as_slice(), Codec::Gzip).unwrap();\nassert_eq!(decompressed.as_slice(), data);\n```\n\n#### Decompress using the Encoder/Decoder structs implementing `io::Write`\n\n```rust\nuse std::{io, io::Write};\nuse isal::{write::Decoder, CompressionLevel, compress, Codec};\n\nlet data = b\"Hello, World!\".to_vec();\nlet compressed = compress(data.as_slice(), CompressionLevel::Three, Codec::Gzip).unwrap();\n\nlet mut decompressed = vec![];\nlet mut decoder = Decoder::new(\u0026mut decompressed, Codec::Gzip);\n\n// Number of compressed bytes written to `output`\nlet n = io::copy(\u0026mut io::Cursor::new(\u0026compressed), \u0026mut decoder).unwrap();\nassert_eq!(n as usize, compressed.len());\n\nassert_eq!(decompressed.as_slice(), data);\n```\n\n---\n\n### Benchmarks\n\nTL/DR: It's roughly 5-10x faster than flate2 with the default features, and\n~2-3x faster using flate2 with zlib-ng backend.\n\nCheckout the [README](./benches/README.md) in the benches directory.\nCriterion benchmark report available here: https://milesgranger.github.io/isal-rs/benches/criterion/report/\n\n_NOTE:_ ISA-L supports compression levels 0, 1, 3. These benchmarks compare gzip using compression level 3\nfor both flate2 and isal-rs.\n\n---\n\n### Versioning: \nVersions are specified in normal SemVer format, and a trailing \"`+\u003c\u003c commit hash \u003e\u003e`\" to indicate\nwhich commit in [isa-l](https://github.com/intel/isa-l) the crate is built against. ie: `0.1.0+62519d9`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesgranger%2Fisal-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesgranger%2Fisal-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesgranger%2Fisal-rs/lists"}