Show HN: Stb_zip – header-only C ZIP parser, zero dependencies, fast

4 Forgret 5 8/24/2025, 8:31:37 AM
I've built a small, header-only C library to parse ZIP archives with no external dependencies. It works on everything from embedded devices to desktop games and supports both "store" and "deflate" compression. Benchmarks (Core i7-12700K, 32GB RAM): - Decompress 1GB: 0.8s (2.1x faster than miniz) - Parse 100k files: 12ms (3.2x faster) - CRC32 of 1GB: 0.2s (5.5x faster)

GitHub: https://github.com/Ferki-git-creator/stb-zip

MIT licensed, feedback welcome.

Comments (5)

AlbertoGP · 6h ago
I tried it out to see if I would want to use this instead of miniz which I am using at the moment, but the example seems to be missing some includes.

I filed an issue with the details: https://github.com/Ferki-git-creator/stb-zip/issues/1

Edit to add: I see now that you also did the Uprintf submission from a few days ago (https://news.ycombinator.com/item?id=44960664) which had some baffling bugs, and then you mentioned that you were using AI for some of it. That might explain the missing parts here too.

Forgret · 5h ago
This is possible not only fault with AI, because I always do tests, but sometimes I don't always manage to cover all platforms like this Linux, because I have to admit that I don't have a PC, and I did all this on my phone.
ycombinatrix · 9h ago
What is the significance of a library being "header-only"?

C headers can include arbitrary code, right? So why is "header-only" better than having file.h & file.c?

gkbrk · 9h ago
Why would I want to deal with downloading and handling multiple files when I can just use a single file?

Turning a header-only library into file.h and file.c is easy if I want to do it. Turning a multi-file project into a single header file is a lot more work.

ycombinatrix · 9h ago
A "header-only" library can presumably be multiple header files, which is not what you are discussing.

Why not say what you really mean? Which seems to be: "single-file" library.