{"id":19457634,"url":"https://github.com/mgproduction/strpack","last_synced_at":"2026-06-11T02:31:48.384Z","repository":{"id":219508535,"uuid":"749044445","full_name":"MGProduction/strpack","owner":"MGProduction","description":"single-file header-only C string compression library (with fast/handy decompression to use also on 8bit machines)","archived":false,"fork":false,"pushed_at":"2024-01-28T18:30:31.000Z","size":96,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-25T11:46:54.265Z","etag":null,"topics":["compression-library","string"],"latest_commit_sha":null,"homepage":"","language":"C","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/MGProduction.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":"2024-01-27T12:27:49.000Z","updated_at":"2024-01-28T13:16:23.000Z","dependencies_parsed_at":"2024-11-10T17:24:54.018Z","dependency_job_id":"d2c0df4e-6947-47d5-8cff-6b00f47a57c7","html_url":"https://github.com/MGProduction/strpack","commit_stats":null,"previous_names":["mgproduction/strpack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MGProduction/strpack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGProduction%2Fstrpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGProduction%2Fstrpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGProduction%2Fstrpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGProduction%2Fstrpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MGProduction","download_url":"https://codeload.github.com/MGProduction/strpack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGProduction%2Fstrpack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34180147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["compression-library","string"],"created_at":"2024-11-10T17:23:14.677Z","updated_at":"2026-06-11T02:31:48.367Z","avatar_url":"https://github.com/MGProduction.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# strpack\nyet another simple string compression (with a fast / handy decompression for use on 8 bit machines as well)\n\nThis simple single-file header-only C library is a modified version of what I use in my **Storytllr64 engine** (IF engine for **C64**) to compress messages and element names. \nIt's supposed to compress even small strings, and it's meant to be used with single-byte char strings (NOT multi-byte, like utf-8).\n\n## usage\n\n\t#define STRPACK_IMPLEMENT\n\t#include \"strpack.h\"\n\t\n\t...\n\tchar pstr[256];\t\n\tstrpack_compress(\"This is a test\",pstr,sizeof(pstr),NULL);\n\t...\n\tchar ostr[256];\n\tstrpack_decompress(pstr,ostr,sizeof(ostr));\n\n\tIf you don't need a compressor (i.e. because you compress resources in a separate program, then your program just uses them) you can add\n \n\t#define STRPACK_DECOMPRESSONLY\n\n\tIf you instead want to optimize strpack internal dictionary you can add \n \n\t#define STRPACK_IMPLEMENT_BUILD\n \n\tand use \n \n\tstrpack_build(\"corpus.txt\", maxsize , maxextsize ,0,\"strpack_dictionary.h\"); \n \t(you can use maxsize\u003c=0 to go auto, or set a maxsize for low dictionary i.e. 128 or 256 bytes)\n\t(maxextsize is the size you want to use for extra dictionary items - corpus dependant - up to 256 bytes. You can set it to zero)\n \n\tto generate a new one and then adding\n \n\t#define STRPACK_USEEXTERNALDICTIONARY\n \n\tto specify that you want to include what is in that file as a dictionary\n\n## info\n\nIt's somewhat similar to other libraries ([smaz](https://github.com/antirez/smaz), [shoco](https://github.com/Ed-von-Schleck/shoco), etc) in that it's a \"dictionary-based\" compressor, BUT it uses a minimal dictionary, with mainly bigrams and a reduced set of longer strings (not yet included, although you can generate trigrams as well), because on low memory systems even dictionary size AND usage is important. \n\nIt also uses some LZ/RLE code (not useful for short strings, but it helps to save extra space in medium-sized clauses).\n\nAs with smaz, compressed strings are still strings, with a /0 at the end (so you can e.g. strcat them and decompress the result).\n\n\nThis is a quick comparison to smaz (using its sample strings)\n\n\t'the' compressed by 34%\n\t'This is a small string' compressed by 46%\n\t'foobar' compressed by 34%\n\t'the end' compressed by 43%\n\t'not-a-g00d-Exampl333' enlarged by 15%\n\t'Smaz is a simple compression library' compressed by 39%\n\t'Nothing is more difficult, and therefore more precious, than to be able to decide' compressed by 46%\n\t'this is an example of what works very well with smaz' compressed by 45%\n\t'1000 numbers 2000 will 10 20 30 compress very little' compressed by 22%\n\t'Nel mezzo del cammin di nostra vita, mi ritrovai in una selva oscura' compressed by 39%\n\t'Mi illumino di immenso' compressed by 37%\n\t'L'autore di questa libreria vive in Sicilia' compressed by 38%\n\t'http://google.com' compressed by 12%\n\t'http://programming.reddit.com' compressed by 25%\n\t'http://github.com/antirez/smaz/tree/master' compressed by 10%\n\t'My name's Marco Giorgini and I live in Modena' compressed by 29%\n\t'L'autore di questa libreria vive in Emilia Romagna' compressed by 34%\n\t'strpack is somewhat similar to smaz or shoco' compressed by 41%\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgproduction%2Fstrpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgproduction%2Fstrpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgproduction%2Fstrpack/lists"}