{"id":13736861,"url":"https://github.com/guzba/zippy","last_synced_at":"2025-09-12T02:42:12.247Z","repository":{"id":40398932,"uuid":"303865390","full_name":"guzba/zippy","owner":"guzba","description":"Pure Nim implementation of deflate, zlib, gzip and zip.","archived":false,"fork":false,"pushed_at":"2024-04-11T18:55:56.000Z","size":95274,"stargazers_count":232,"open_issues_count":13,"forks_count":27,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-12T11:32:07.370Z","etag":null,"topics":["compression","deflate","gzip","huffman-coding","lz77","nim","tarball","zip","zlib"],"latest_commit_sha":null,"homepage":"","language":"Nim","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guzba.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}},"created_at":"2020-10-14T00:59:06.000Z","updated_at":"2024-04-15T06:29:46.883Z","dependencies_parsed_at":"2024-04-15T06:29:39.713Z","dependency_job_id":"10f16122-fce2-4610-9720-5c956b3fac45","html_url":"https://github.com/guzba/zippy","commit_stats":null,"previous_names":[],"tags_count":78,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fzippy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fzippy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fzippy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guzba%2Fzippy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guzba","download_url":"https://codeload.github.com/guzba/zippy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244882344,"owners_count":20525836,"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","deflate","gzip","huffman-coding","lz77","nim","tarball","zip","zlib"],"created_at":"2024-08-03T03:01:29.907Z","updated_at":"2025-03-21T23:26:46.669Z","avatar_url":"https://github.com/guzba.png","language":"Nim","funding_links":[],"categories":["Algorithms"],"sub_categories":["Compression"],"readme":"# Zippy\n\n`nimble install zippy`\n\n![Github Actions](https://github.com/guzba/zippy/workflows/Github%20Actions/badge.svg)\n\n[API reference](https://guzba.github.io/zippy/)\n\nZippy is an implementation of [DEFLATE](https://tools.ietf.org/html/rfc1951), [ZLIB](https://tools.ietf.org/html/rfc1950) and [GZIP](https://tools.ietf.org/html/rfc1952) data compression formats.\n\nZippy can also open [ZIP archives](https://en.wikipedia.org/wiki/Zip_(file_format)) (.zip) and [Tarballs](https://en.wikipedia.org/wiki/Tar_(computing)) (.tar, .tar.gz, .tgz, .taz).\n\nThe goal of this library is to be a pure Nim implementation that is small, performant and dependency-free.\n\nTo ensure Zippy is compatible with other implementations, `tests/validate.nim` can be run. This script verifies that data compressed by Zippy can be uncompressed by other implementations (and that other implementations can uncompress data compressed by Zippy).\n\nThis library works well using Nim's `--gc:arc` and `--gc:orc` as well as the default garbage collector. This library also works using both `nim c` and `nim cpp`, in addition to `--cc:vcc` on Windows.\n\n## Examples\n\nSimple examples using Zippy can be found in the [examples/](https://github.com/guzba/zippy/blob/master/examples) folder.\n\n* [HTTP client gzip](https://github.com/guzba/zippy/blob/master/examples/http_client.nim)\n* [HTTP server gzip](https://github.com/guzba/zippy/blob/master/examples/http_server.nim)\n* Extract individual files from [zip archive](https://github.com/guzba/zippy/blob/master/examples/ziparchive_explore.nim).\n* Extract everything from a [zip archive](https://github.com/guzba/zippy/blob/master/examples/ziparchive_extract.nim) or [tarball](https://github.com/guzba/zippy/blob/master/examples/tarball_extract.nim)\n\n## Performance\n\nBenchmarks can be run comparing different deflate implementations. My benchmarking shows this library performs very well, around 1.5x - 2x faster than zlib found on a fresh Linux install. Check the performance yourself by running [tests/benchmark.nim](https://github.com/guzba/zippy/blob/master/tests/benchmark.nim).\n\n`nim c --gc:arc -d:release -r .\\tests\\benchmark.nim`\n\nThe times below are measured on a Ryzen 5 5600X.\n\n### Uncompress\n\n```\nhttps://github.com/guzba/zippy uncompress\nname ............................... min time      avg time    std dv   runs\nalice29.txt.gz ..................... 0.233 ms      0.235 ms    ±0.003  x1000\nurls.10K.gz ........................ 1.140 ms      1.148 ms    ±0.007  x1000\nrfctest3.gz ........................ 0.047 ms      0.048 ms    ±0.001  x1000\nrandtest3.gz ....................... 0.001 ms      0.001 ms    ±0.000  x1000\npaper-100k.pdf.gz .................. 0.210 ms      0.212 ms    ±0.001  x1000\ngeo.protodata.gz ................... 0.068 ms      0.071 ms    ±0.002  x1000\ntor-list.gz ....................... 27.297 ms     27.520 ms    ±0.277   x182\nhttps://github.com/nim-lang/zip uncompress\nalice29.txt.gz ..................... 0.397 ms      0.403 ms    ±0.004  x1000\nurls.10K.gz ........................ 1.719 ms      1.731 ms    ±0.009  x1000\nrfctest3.gz ........................ 0.054 ms      0.055 ms    ±0.002  x1000\nrandtest3.gz ....................... 0.008 ms      0.008 ms    ±0.000  x1000\npaper-100k.pdf.gz .................. 0.250 ms      0.252 ms    ±0.001  x1000\ngeo.protodata.gz ................... 0.126 ms      0.132 ms    ±0.005  x1000\ntor-list.gz ....................... 36.613 ms     37.061 ms    ±0.423   x135\n```\n\n### Compress\n\n```\nhttps://github.com/guzba/zippy compress [best speed]\nname ............................... min time      avg time    std dv   runs\nalice29.txt ........................ 0.643 ms      0.655 ms    ±0.017  x1000\nurls.10K ........................... 1.943 ms      1.959 ms    ±0.022  x1000\nrfctest3.gold ...................... 0.119 ms      0.121 ms    ±0.003  x1000\nrandtest3.gold ..................... 0.005 ms      0.006 ms    ±0.001  x1000\npaper-100k.pdf ..................... 0.230 ms      0.235 ms    ±0.003  x1000\ngeo.protodata ...................... 0.192 ms      0.195 ms    ±0.003  x1000\ngzipfiletest.txt ................... 0.002 ms      0.002 ms    ±0.000  x1000\ntor-list.gold ..................... 26.106 ms     26.418 ms    ±0.370   x189\nhttps://github.com/nim-lang/zip compress [best speed]\nalice29.txt ........................ 1.236 ms      1.245 ms    ±0.010  x1000\nurls.10K ........................... 5.155 ms      5.222 ms    ±0.092   x952\nrfctest3.gold ...................... 0.205 ms      0.232 ms    ±0.009  x1000\nrandtest3.gold ..................... 0.076 ms      0.097 ms    ±0.013  x1000\npaper-100k.pdf ..................... 1.250 ms      1.276 ms    ±0.023  x1000\ngeo.protodata ...................... 0.313 ms      0.320 ms    ±0.006  x1000\ngzipfiletest.txt ................... 0.006 ms      0.008 ms    ±0.001  x1000\ntor-list.gold .................... 178.197 ms    179.970 ms    ±1.559    x28\n\nhttps://github.com/guzba/zippy compress [default]\nname ............................... min time      avg time    std dv   runs\nalice29.txt ........................ 2.361 ms      2.379 ms    ±0.024  x1000\nurls.10K .......................... 13.364 ms     13.432 ms    ±0.036   x372\nrfctest3.gold ...................... 0.335 ms      0.342 ms    ±0.009  x1000\nrandtest3.gold ..................... 0.048 ms      0.049 ms    ±0.000  x1000\npaper-100k.pdf ..................... 0.831 ms      0.843 ms    ±0.010  x1000\ngeo.protodata ...................... 0.563 ms      0.570 ms    ±0.007  x1000\ngzipfiletest.txt ................... 0.008 ms      0.008 ms    ±0.001  x1000\ntor-list.gold .................... 409.542 ms    411.858 ms    ±1.779    x13\nhttps://github.com/nim-lang/zip compress [default]\nalice29.txt ........................ 5.726 ms      5.766 ms    ±0.053   x862\nurls.10K .......................... 13.049 ms     13.106 ms    ±0.057   x381\nrfctest3.gold ...................... 0.637 ms      0.644 ms    ±0.007  x1000\nrandtest3.gold ..................... 0.083 ms      0.087 ms    ±0.007  x1000\npaper-100k.pdf ..................... 1.467 ms      1.490 ms    ±0.023  x1000\ngeo.protodata ...................... 0.867 ms      0.879 ms    ±0.011  x1000\ngzipfiletest.txt ................... 0.009 ms      0.010 ms    ±0.001  x1000\ntor-list.gold .................... 244.424 ms    246.601 ms    ±1.630    x21\n```\n\n## Testing\n\n`nimble test`\n\nTo prevent Zippy from causing a crash or otherwise misbehaving on bad input data, a fuzzer has been run against it. You can run the fuzzer any time by running `nim c -r tests/fuzz.nim` and `nim c -r tests/stress.nim`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguzba%2Fzippy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguzba%2Fzippy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguzba%2Fzippy/lists"}