{"id":17673643,"url":"https://github.com/codetheweb/palmdoc-compression","last_synced_at":"2025-09-02T19:47:32.244Z","repository":{"id":232529537,"uuid":"779508778","full_name":"codetheweb/palmdoc-compression","owner":"codetheweb","description":"Fast \u0026 safe implementation of Kindle/PalmDoc flavored LZ77","archived":false,"fork":false,"pushed_at":"2024-07-22T05:29:45.000Z","size":1222,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-10T21:58:20.728Z","etag":null,"topics":["azw3","compression","kindle","lz77"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/palmdoc-compression","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/codetheweb.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-03-30T02:24:51.000Z","updated_at":"2025-03-21T18:56:51.000Z","dependencies_parsed_at":"2024-04-13T21:30:14.179Z","dependency_job_id":"32b9c8c6-474b-498e-913b-e55d35665c77","html_url":"https://github.com/codetheweb/palmdoc-compression","commit_stats":null,"previous_names":["codetheweb/palmdoc-compression"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/codetheweb/palmdoc-compression","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Fpalmdoc-compression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Fpalmdoc-compression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Fpalmdoc-compression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Fpalmdoc-compression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codetheweb","download_url":"https://codeload.github.com/codetheweb/palmdoc-compression/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheweb%2Fpalmdoc-compression/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273341430,"owners_count":25088346,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["azw3","compression","kindle","lz77"],"created_at":"2024-10-24T05:42:43.328Z","updated_at":"2025-09-02T19:47:32.195Z","avatar_url":"https://github.com/codetheweb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖐️ palmdoc-compression\n\n[![docs.rs](https://img.shields.io/docsrs/palmdoc-compression)](https://docs.rs/palmdoc-compression/latest/palmdoc_compression/)\n\nThis is a fast, safe, and correct implementation of PalmDoc-flavored LZ77 compression (primarily used by Amazon ebook formats). Compression is **300-400x** faster than Calibre's implementation with a comparable compression ratio.\n\nThis crate also includes Calibre's version for comparison and usage if desired, gated behind the `calibre` feature.\n\n## Usage\n\n```rust\nuse palmdoc_compression::{compress, decompress};\n\nlet data = b\"hello world\";\n\nlet compressed = compress(data);\nlet decompressed = decompress(\u0026compressed).unwrap();\n\nassert_eq!(data, decompressed);\n```\n\n## ⚡ Benchmarks\n\nMOBI/AZW files are split into 4KB chunks, so benchmarks here also use 4KB chunks. Benchmarks were run on a M1 Max.\n\nFor a 4KB chunk of lorem ipsum text:\n\n|                     | Decompression | Compression |\n|---------------------|---------------|-------------|\n| Calibre             | 922 MiB/s     | 252 KiB/s   |\n| palmdoc-compression | 797 MiB/s     | 109 MiB/s   |\n\n\nFor a random 4KB chunk of War and Peace from Project Gutenberg:\n\n|                     | Decompression | Compression |\n|---------------------|---------------|-------------|\n| Calibre             | 1011 MiB/s    | 336 KiB/s   |\n| palmdoc-compression | 876 MiB/s     | 103 MiB/s   |\n\n(Reproduce with `cargo bench --features calibre`.)\n\n## Compression ratio\n\nRatios calculated by compressing War and Peace from Project Gutenberg in 4KB chunks.\n\n|                     | ratio, ⬇️ is better      |\n|---------------------|-------------------------|\n| calibre             | 0.56% (theoretical max) |\n| palmdoc-compression | 0.57%                   |\n\n(Reproduce with `cargo run --example ratios --release --features calibre`.)\n\n## Credits\n\n- [LPeter1997](https://github.com/LPeter1997) for a clear and understandable Rust LZ77 implementation with [hash chains](https://gist.github.com/LPeter1997/1c88e7540d03552cacd875eb82caad8d)\n- Calibre for a reference implementation with tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheweb%2Fpalmdoc-compression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodetheweb%2Fpalmdoc-compression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheweb%2Fpalmdoc-compression/lists"}