{"id":24091765,"url":"https://github.com/RT-Thread-packages/zlib","last_synced_at":"2025-09-17T01:32:04.701Z","repository":{"id":51587506,"uuid":"134028587","full_name":"RT-Thread-packages/zlib","owner":"RT-Thread-packages","description":"general purpose data compression library","archived":false,"fork":false,"pushed_at":"2024-02-23T01:16:16.000Z","size":405,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-10T07:51:16.203Z","etag":null,"topics":["gz","gzip","gzip-compression","gzip-decompression","zlib"],"latest_commit_sha":null,"homepage":null,"language":"C","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/RT-Thread-packages.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":"2018-05-19T04:11:42.000Z","updated_at":"2024-06-25T10:36:34.000Z","dependencies_parsed_at":"2025-01-10T12:31:19.543Z","dependency_job_id":null,"html_url":"https://github.com/RT-Thread-packages/zlib","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/RT-Thread-packages/zlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fzlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fzlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fzlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fzlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RT-Thread-packages","download_url":"https://codeload.github.com/RT-Thread-packages/zlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fzlib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275519822,"owners_count":25479465,"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-16T02:00:10.229Z","response_time":65,"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":["gz","gzip","gzip-compression","gzip-decompression","zlib"],"created_at":"2025-01-10T07:44:42.125Z","updated_at":"2025-09-17T01:32:04.685Z","avatar_url":"https://github.com/RT-Thread-packages.png","language":"C","readme":"# zlib for RT-Thread 通用数据压缩库 \n\n## 1、介绍\n\nZlib 是一款免费的、通用的、合法的、不受任何限制的无损数据压缩库，使用 zlib 库可以轻松实现 gzip 格式压缩。该库提供多种不同压缩方式，如最快速度和最大压缩比压缩，各种配置选项可以参考 `zconf.h` 文件。\n\n本软件包是 RT-thread 针对 [zlib](https://github.com/madler/zlib) 官方 1.2.11 版本的移植， 更多信息请参阅[官方文档](http://www.zlib.net/) 。\n\n## 2、获取方式\n\n```\nRT-Thread online package -\u003e \n     miscellaneous package -\u003e \n         [*] zlib: general purpose data compression library.  ---\u003e\n```\n\n## 3、示例介绍\n\n### 3.1 运行示例\n\n该示例为一个简单的文件压缩和解压的例程，需要依赖文件系统，用到的 `zlib_test` 命令有两个 `-c` 和  `-d` 两个参数。使用 `-c` 参数将会压缩一个文件到另一个文件，`-d` 命令解压一个压缩文件到另一个文件。 \n\n使用方式：\n\n压缩命令： `zlib_test -c test test_com`  \n\n注意：压缩的过程需要大约 270 k 内存，否则由于内存不够而压缩失败。\n\n```c\nmsh /\u003ezlib_test -c test test_com\nmsh /\u003els\nDirectory /:\ntest                145          //压缩前文件大小为 145 字节 \ntest_com            77           //压缩后文件大小为 77 字节\n```\n解压命令： `zlib_test -d test_com test_decom  `\n\n```c\nmsh /\u003ezlib_test -d test_com test_decom\nmsh /\u003els\nDirectory /:\ntest                145          \ntest_com            77          //压缩后文件大小为 77 字节\ntest_decom          145         //解压后文件大小为 145 字节\n```\n\n## 4、常见问题\n\n注意，压缩文件需要大约 270 k 内存，如果内存不够会出现压缩失败的情况。\n\n解压文件大约需要 18 k 内存占用。\n\n## 5、维护\n维护：[Meco Man](https://github.com/mysterywolf)\n\n主页：\u003chttps://github.com/RT-Thread-packages/zlib\u003e","funding_links":[],"categories":["Packages"],"sub_categories":["Misc"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRT-Thread-packages%2Fzlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRT-Thread-packages%2Fzlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRT-Thread-packages%2Fzlib/lists"}