{"id":13628750,"url":"https://github.com/antirez/smaz","last_synced_at":"2025-04-13T00:46:37.290Z","repository":{"id":41063304,"uuid":"164020","full_name":"antirez/smaz","owner":"antirez","description":"Small strings compression library","archived":false,"fork":false,"pushed_at":"2019-10-25T15:29:28.000Z","size":212,"stargazers_count":1185,"open_issues_count":12,"forks_count":133,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-13T00:46:30.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antirez.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-03-31T11:58:47.000Z","updated_at":"2025-04-11T13:06:05.000Z","dependencies_parsed_at":"2022-08-10T01:31:29.857Z","dependency_job_id":null,"html_url":"https://github.com/antirez/smaz","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/antirez%2Fsmaz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fsmaz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fsmaz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antirez%2Fsmaz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antirez","download_url":"https://codeload.github.com/antirez/smaz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"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":[],"created_at":"2024-08-01T22:00:56.970Z","updated_at":"2025-04-13T00:46:37.270Z","avatar_url":"https://github.com/antirez.png","language":"C","readme":"SMAZ - compression for very small strings\n-----------------------------------------\n\nSmaz is a simple compression library suitable for compressing very short\nstrings. General purpose compression libraries will build the state needed\nfor compressing data dynamically, in order to be able to compress every kind\nof data. This is a very good idea, but not for a specific problem: compressing\nsmall strings will not work.\n\nSmaz instead is not good for compressing general purpose data, but can compress\ntext by 40-50% in the average case (works better with English), and is able to\nperform a bit of compression for HTML and urls as well. The important point is\nthat Smaz is able to compress even strings of two or three bytes!\n\nFor example the string \"the\" is compressed into a single byte.\n\nTo compare this with other libraries, think that like zlib will usually not be able to compress text shorter than 100 bytes.\n\nCOMPRESSION EXAMPLES\n--------------------\n\n'This is a small string' compressed by 50%\n'foobar' compressed by 34%\n'the end' compressed by 58%\n'not-a-g00d-Exampl333' enlarged by 15%\n'Smaz is a simple compression library' compressed by 39%\n'Nothing is more difficult, and therefore more precious, than to be able to decide' compressed by 49%\n'this is an example of what works very well with smaz' compressed by 49%\n'1000 numbers 2000 will 10 20 30 compress very little' compressed by 10%\n\nIn general, lowercase English will work very well. It will suck with a lot\nof numbers inside the strings. Other languages are compressed pretty well too,\nthe following is Italian, not very similar to English but still compressible\nby smaz:\n\n'Nel mezzo del cammin di nostra vita, mi ritrovai in una selva oscura' compressed by 33%\n'Mi illumino di immenso' compressed by 37%\n'L'autore di questa libreria vive in Sicilia' compressed by 28%\n\nIt can compress URLS pretty well:\n\n'http://google.com' compressed by 59%\n'http://programming.reddit.com' compressed by 52%\n'http://github.com/antirez/smaz/tree/master' compressed by 46%\n\nUSAGE\n-----\n\nThe lib consists of just two functions:\n\n    int smaz_compress(char *in, int inlen, char *out, int outlen);\n\nCompress the buffer 'in' of length 'inlen' and put the compressed data into\n'out' of max length 'outlen' bytes. If the output buffer is too short to hold\nthe whole compressed string, outlen+1 is returned. Otherwise the length of the\ncompressed string (less then or equal to outlen) is returned.\n\n    int smaz_decompress(char *in, int inlen, char *out, int outlen);\n\nDecompress the buffer 'in' of length 'inlen' and put the decompressed data into\n'out' of max length 'outlen' bytes. If the output buffer is too short to hold\nthe whole decompressed string, outlen+1 is returned. Otherwise the length of the\ncompressed string (less then or equal to outlen) is returned. This function will\nnot automatically put a nul-term at the end of the string if the original\ncompressed string didn't included a nulterm.\n\n\nCREDITS\n-------\n\nSmall was writte by Salvatore Sanfilippo and is released under the BSD license. Check the COPYING file for more information.\n","funding_links":[],"categories":["Compression","C","SMAZ","压缩","Compression Tools","String Manipulation ##","Data processing"],"sub_categories":["Web Frameworks ###","Compression"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantirez%2Fsmaz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantirez%2Fsmaz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantirez%2Fsmaz/lists"}