{"id":13777840,"url":"https://github.com/sjnam/luajit-zstd","last_synced_at":"2025-05-11T11:34:18.755Z","repository":{"id":41345626,"uuid":"81924345","full_name":"sjnam/luajit-zstd","owner":"sjnam","description":"Facebook zstandard ffi binding","archived":true,"fork":false,"pushed_at":"2019-04-27T08:30:48.000Z","size":60,"stargazers_count":26,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-18T20:47:26.684Z","etag":null,"topics":["compresses","zstandard"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjnam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-14T08:45:21.000Z","updated_at":"2024-01-16T21:19:25.000Z","dependencies_parsed_at":"2022-09-13T02:23:03.659Z","dependency_job_id":null,"html_url":"https://github.com/sjnam/luajit-zstd","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjnam%2Fluajit-zstd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjnam%2Fluajit-zstd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjnam%2Fluajit-zstd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjnam%2Fluajit-zstd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjnam","download_url":"https://codeload.github.com/sjnam/luajit-zstd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253559445,"owners_count":21927591,"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":["compresses","zstandard"],"created_at":"2024-08-03T18:00:49.183Z","updated_at":"2025-05-11T11:34:18.435Z","avatar_url":"https://github.com/sjnam.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"Name\n====\nluajit-zstd - facebook [zstandard](https://github.com/facebook/zstd) ffi binding\n\n\nInstallation\n============\nTo install `luajit-zstd` you need to install\n[Zstandard](https://github.com/facebook/zstd#build)\nwith shared libraries firtst.\nThen you can install `luajit-zstd` by placing `lib/zstd.lua` to\nyour lua library path.\n\nExample\n=======\n```` lua\nlocal zstandard = require \"zstd\"\nlocal zstd = zstandard:new()\nlocal txt = string.rep(\"ABCD\", 1000)\nprint(\"Uncompressed size:\", #txt)\nlocal c, err = zstd:compress(txt)\nprint(\"Compressed size:\", #c)\nlocal txt2, err = zstd:decompress(c)\nassert(txt == txt2)\nzstd:free()\n````\n\nMethods\n=======\n\nnew\n---\n`syntax: zstd = zstandard:new()`\n\nCreate cstream and dstream.\n\nfree\n----\n`syntax: zstd:free()`\n\nFree cstream and dstream.\n\ncompress\n--------\n`syntax: encoded_buffer, err = zstd:compress(input_buffer, clvl)`\n\nCompresses the data in input_buffer into encoded_buffer.\n\ndecompress\n----------\n`syntax: decoded_buffer, err = zstd:decompress(encoded_buffer)`\n\nDecompresses the data in encoded_buffer into decoded_buffer.\n\ncompressFile\n--------------\n`syntax: ok, err = zstd:compressFile(path, clvl?)`\n\nCompresses the input file with clvl compression level.\n\ndecompressFile\n--------------\n`syntax: ok, err = zstd:decompressFile(fname, outname?)`\n\nDecompress the input file fname.\n\ncompressFileUsingDictionary\n--------------\n`syntax: ok, err = zstd:compressFileUsingDictionary(path, dict, clvl?)`\n\nCompresses the input file with clvl compression level using a digested Dictionary.\n\ndecompressFileUsingDictionary\n--------------\n`syntax: ok, err = zstd:decompressFileUsingDictionary(fname, dict, outname?)`\n\nDecompress the input file fname using a digested Dictionary.\n\nAuthor\n======\nSoojin Nam jsunam@gamil.com\n\nLicense\n=======\nPublic Domain\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjnam%2Fluajit-zstd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjnam%2Fluajit-zstd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjnam%2Fluajit-zstd/lists"}