{"id":13466389,"url":"https://github.com/wkoszek/mini_gzip","last_synced_at":"2026-01-05T13:01:28.641Z","repository":{"id":9518529,"uuid":"11416250","full_name":"wkoszek/mini_gzip","owner":"wkoszek","description":"mini_gzip - embeddable, minimal, in-memory GZIP API","archived":false,"fork":false,"pushed_at":"2023-06-09T11:32:24.000Z","size":48,"stargazers_count":115,"open_issues_count":2,"forks_count":26,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-24T01:44:58.541Z","etag":null,"topics":["c","compression","decompression","embeddable","gzip","mini-gzip","zlib"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wkoszek.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}},"created_at":"2013-07-15T06:21:14.000Z","updated_at":"2025-01-19T08:43:25.000Z","dependencies_parsed_at":"2024-01-18T20:23:57.041Z","dependency_job_id":null,"html_url":"https://github.com/wkoszek/mini_gzip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkoszek%2Fmini_gzip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkoszek%2Fmini_gzip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkoszek%2Fmini_gzip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkoszek%2Fmini_gzip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wkoszek","download_url":"https://codeload.github.com/wkoszek/mini_gzip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245548254,"owners_count":20633546,"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":["c","compression","decompression","embeddable","gzip","mini-gzip","zlib"],"created_at":"2024-07-31T15:00:43.368Z","updated_at":"2026-01-05T13:01:28.567Z","avatar_url":"https://github.com/wkoszek.png","language":"C","readme":"mini_gzip - embeddable, minimal, in-memory GZIP API\n===================================================\n\n[![Build Status](https://travis-ci.org/wkoszek/mini_gzip.svg?branch=master)](https://travis-ci.org/wkoszek/mini_gzip)\n\nEmbeddable, minimal GZIP functionality, with API designed to work from\nmemory. Only supports decompression for now.\n\nI wrote it when I needed a small piece of code to give me decompression in\nan embedded system I was working with, and I found out that most of the\nGZIP-related programs use POSIX `FILE` API, which made the examples not work\nfor my case.\n\nThe `mini_gzip` is based on `miniz` library\n(https://code.google.com/p/miniz/), which provides an API for operating on\ndata compressed according to deflate algorithm. Added is a layer which\nprovides a container for the GZIP files and let me do some verification.\n\n# To build\n\nEverything should be fairly self-contained, and built with:\n\n\tmake\n\n# How to use\n\nThe API operates on `struct mini_gzip` structures, which are containers for\nthe memory with GZIPed data. You must call `mini_gz_init()` on the structure\n1st for the rest of the API to work correctly. Next, you must call\n`mini_gz_start(\u0026gz, mem_in, size)`, where `gz` is the initialized container\nand with GZIPed data pointed by `mem_in` of the size of `size`.  To unpack,\nyou call `mini_gz_unpack(\u0026gz, mem_out, memsize)`, where the first argument\nis the initialized container, the second `mem_out` is a pointer to the\noutput memory, and `memsize` is its lenght. It's important to have enough\nbytes in the output buffer for decompressed data.\n\n# To test\n\nSimple test is provided:\n\n\tmake test\n\nTo test by yourself, you can do:\n\n~~~shell\n\twk:/w/repos/mini_gzip\u003e ls -la miniz.o\n\t-rw-r--r--  1 wk  staff  114348 20 paź 09:46 miniz.o\n\twk:/w/repos/mini_gzip\u003e md5 miniz.o\n\tMD5 (miniz.o) = e6199aade2020b6040fa160baee47d68\n\twk:/w/repos/mini_gzip\u003e gzip miniz.o\n\twk:/w/repos/mini_gzip\u003e ls -la miniz.o.gz\n\t-rw-r--r--  1 wk  staff  44965 20 paź 09:46 miniz.o.gz\n\twk:/w/repos/mini_gzip\u003e ./mini_gzip miniz.o.gz miniz.o\n\tflag_c: 0 is_gzipped: 1\n\tin_fn: miniz.o.gz out_fn: miniz.o level 6\n\t--- testing decompression --\n\tout_len = 114348\n\tret = 114348\n\twk:/w/repos/mini_gzip\u003e md5 miniz.o\n\tMD5 (miniz.o) = e6199aade2020b6040fa160baee47d68\n~~~\n\n# References\n\nAfter publishing `mini_gzip` on HackerNews, byuu (http://byuu.org/) mentioned he has much leaner implementation of GZIP:\n\n- https://gitlab.com/higan/higan/blob/master/nall/decode/gzip.hpp\n- https://gitlab.com/higan/higan/blob/master/nall/decode/inflate.hpp\n\n# Author\n\n- Wojciech Adam Koszek, [wojciech@koszek.com](mailto:wojciech@koszek.com)\n- [http://www.koszek.com](http://www.koszek.com)\n","funding_links":[],"categories":["C"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkoszek%2Fmini_gzip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwkoszek%2Fmini_gzip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkoszek%2Fmini_gzip/lists"}