{"id":16130185,"url":"https://github.com/lambdacasserole/lizard","last_synced_at":"2026-04-30T10:06:24.691Z","repository":{"id":75385871,"uuid":"59675781","full_name":"lambdacasserole/lizard","owner":"lambdacasserole","description":"Lempel–Ziv–Welch data compression Maven package for Java.","archived":false,"fork":false,"pushed_at":"2016-05-26T14:41:27.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T20:17:21.445Z","etag":null,"topics":["compression","java","lzw","maven"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/lambdacasserole.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,"publiccode":null,"codemeta":null}},"created_at":"2016-05-25T15:37:52.000Z","updated_at":"2019-10-01T02:04:03.000Z","dependencies_parsed_at":"2023-06-06T08:45:33.309Z","dependency_job_id":null,"html_url":"https://github.com/lambdacasserole/lizard","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Flizard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Flizard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Flizard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdacasserole%2Flizard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdacasserole","download_url":"https://codeload.github.com/lambdacasserole/lizard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492543,"owners_count":20947545,"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","java","lzw","maven"],"created_at":"2024-10-09T22:14:56.711Z","updated_at":"2026-04-30T10:06:19.670Z","avatar_url":"https://github.com/lambdacasserole.png","language":"Java","readme":"# Lizard\nLempel–Ziv–Welch data compression Maven package for Java.\n\nLizard is a compression library designed to apply LZW compression over byte arrays. When you need to squeeze some data down to a smaller size (for transmission over a network, for example) LZW is a good choice in a pinch. It'll give you a smaller byte array (usually) and you won't need to transfer any kind of lookup table along with your data for decompression (like you would with [Huffman coding](https://github.com/lambdacasserole/huff) for instance).\n\n## Specifications\nThe term \"LZW compression\" is pretty vague. More specifically, Lizard:\n+ Uses fixed-length, 16-bit codes.\n+ Clears the dictionary as soon as it becomes full.\n\n## Installation\nYou can pull this package into your Maven project straight from here using JitPack. Add JitPack as a repository first:\n\n```\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n```\n\nThen add a dependency on Lizard:\n\n```\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecom.github.lambdacasserole\u003c/groupId\u003e\n        \u003cartifactId\u003elizard\u003c/artifactId\u003e\n        \u003cversion\u003ev1.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Limitations\nLizard won't produce archive files out-of-the-box. It's a lower-level tool for dealing with LZW compression directly. It is not optimized for speed, memory efficiency or performance. This is a naïve implementation and *oh boy is it slow*. Seriously, I literally use hexadecimal strings to build dictionary entries (yeah, I know). Note also that the code dictionary is cleared as soon as it becomes full. This creates a way-less-than-optimal compression ratio.\n\n## Benchmarks\nOnce again, this package isn't designed for straight-up file compression out of the box. If you do use it for that, however, here are some benchmarks running against the [Canterbury Corpus](http://corpus.canterbury.ac.nz/). Times are for a 1.58GHz x64 CPU with 4GB available RAM.\n\n| File         | Uncompressed (Bytes) | Compressed (Bytes) | Ratio | Space Saving | Time (ms) |\n|--------------|----------------------|--------------------|-------|--------------|-----------|\n| alice29.txt  | 152089               | 74148              | 2.05  | 51%          | 506.3     |\n| asyoulik.txt | 125179               | 62748              | 1.99  | 50%          | 183.8     |\n| cp.html      | 24603                | 14948              | 1.65  | 39%          | 17.2      |\n| fields.c     | 11150                | 7084               | 1.57  | 36%          | 11.9      |\n| grammar.lsp  | 3721                 | 2818               | 1.32  | 24%          | 2.5       |\n| kennedy.xls  | 1029744              | 339080             | 3.03  | 67%          | 1608.1    |\n| lcet10.txt   | 426754               | 203626             | 2.10  | 52%          | 556.0     |\n| plrabn12.txt | 481861               | 243968             | 1.98  | 49%          | 771.5     |\n| ptt5         | 513216               | 72850              | 7.04  | 86%          | 1127.4    |\n| sum          | 38240                | 25054              | 1.53  | 34%          | 88.6      |\n| xargs.1      | 4227                 | 3584               | 1.18  | 15%          | 2.5       |\n\n## Contributing\nFor most intents and purposes, Lizard is considered to fulfil its original use case. Bug fixes and suggestions are welcome, however, from any member of the community.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdacasserole%2Flizard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdacasserole%2Flizard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdacasserole%2Flizard/lists"}