{"id":19599735,"url":"https://github.com/starwing/lua-miniz","last_synced_at":"2025-04-27T16:32:08.257Z","repository":{"id":137297208,"uuid":"44051082","full_name":"starwing/lua-miniz","owner":"starwing","description":"Lua module for miniz support","archived":false,"fork":false,"pushed_at":"2024-07-11T01:30:35.000Z","size":338,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T01:32:09.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/starwing.png","metadata":{"files":{"readme":"README.txt","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-11T12:22:46.000Z","updated_at":"2024-09-14T23:44:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3378c1a-8dfe-4b2a-b7c5-bf7350a991ca","html_url":"https://github.com/starwing/lua-miniz","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/starwing%2Flua-miniz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-miniz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-miniz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwing%2Flua-miniz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starwing","download_url":"https://codeload.github.com/starwing/lua-miniz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251171449,"owners_count":21547112,"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-11-11T09:12:17.216Z","updated_at":"2025-04-27T16:32:07.848Z","avatar_url":"https://github.com/starwing.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"lua-miniz - Lua module for miniz support\n\nThis module add deflate/inflate and zip file operations support to Lua\nlanguage. some code from luvit's miniz module, thanks for that work!\n\nlicense:\nThis module has the same license with Lua (the Lua license here[1]).\nnote that the modified version of miniz.c has its own license (see miniz.c file).\n\n[1]: https://www.lua.org/license.html\n\nbuild:\n\nuse your fabourite compiler to build lminiz.c and miniz.c, get miniz.dll\nor miniz.so\n\nusage:\n\nlocal miniz = require \"miniz\"\n\n\nfunctions:\n\nminiz.adler32([string[, prev: number]]) -\u003e number\nminiz.crc32([string[, prev: number]]) -\u003e number\n    calculate adler32 and crc32 checksum for string. without arguments, give a\n    initialize checksum.\n\n    local a = miniz.crc32(\"hello\")\n    local b = miniz.crc32(\"world\", a)\n    -- a is the checksum of \"hello\", and b is the checksum of \"helloworld\"\n\nminiz.compress(string[, level: number[, window_size: number]]) -\u003e [string]\nminiz.decompress(string[, window_bits: number]) -\u003e [string]\n    compress/decompress string, use given flags.\n    when window_size and window_bits are negature, the compress result will\n    not include a zlib-compatible header.\n\nminiz.compress([level: number[, window_size: number]]) -\u003e [stream]\nminiz.decompress([window_bits: number]) -\u003e [stream]\n    create a new compress/decompress stream,\n\n    when compress:\n    output, eof, input_bytes, output_bytes = stream(string[, flush])\n    where flush are \"sync\", \"full\" or \"finish\"\n\n    when decompress:\n    output, eof, input_bytes, output_bytes = stream(string)\n\n    same as lua-zlib module.\n\nminiz.zip_read_file(filename: string[, flags: number]) -\u003e [miniz.ZipReader]\nminiz.zip_read_string(content: string[, flags: number]) -\u003e [miniz.ZipReader]\n    read a zip from file (given filename) or content string.\n\n    flags: (from miniz.c)\n\t0x100: case sensitive file name in zip file.\n\t0x200: ignore path of file in zip.\n\t0x400: file is compressed data.\n\t0x800: do not sort central directory in zip file.\n\nminiz.zip_write_file(filename: string[, reserved: number]) -\u003e miniz.ZipWriter\nminiz.zip_write_string([reserved: number[, init_size: number]]) -\u003e miniz.ZipWriter\n    write files to a zip file or a string.\n    reserved is the reserved size before zip file itself. init_size is the\n    first allocated memory for write file content. \n\n#ZipReader -\u003e number\nZipReader:get_num_files() -\u003e number\n    get the file count in zip file.\n\nZipReader[idx:number] -\u003e string\nZipReader:get_filename(idx:number) -\u003e string\n    get the idx-th file name in zip file.\n\nZipReader:close() -\u003e boolean\n    close zip file, return success or not.\n\nZipReader:locate_file(filename: string) -\u003e number\n    get the index from file name\n\nZipReader:stat(idx: number) -\u003e table\n    get file information from given index.\n\n    returned table fields:\n\tindex: index of file\n\tversion_made_by: zip version\n\tversion_needed: extract file need version\n\tbit_flag: flags of file\n\tmethod: compress method\n\ttime: file time\n\tcrc32: file crc32 checksum\n\tcomp_size: compressed size\n\tuncomp_size: uncompressed size\n\tinternal_attr: internal attribute\n\texternal_attr: external attribute\n\tfilename: filename\n\tcomment: comment\n\nZipReader:is_file_a_directory(idx: number) -\u003e boolean\n    return whether given idx of file is a directory.\n\nZipReader:get_offset() -\u003e number\n    get the start offset of zip file in given file/string.\n\nZipReader:extract(idx: number[, flags: number]) -\u003e [string]\nZipReader:extract(filename: string[, flags: number]) -\u003e [string]\n    extract a file from zip. flags see miniz.zip_read_file()\n\nZipWriter:close() -\u003e boolean\n    close a zip file\n\nZipWriter:add_string(path: string, content: string[, comment: string[, flags: number]]) -\u003e ZipWriter\nZipWriter:add_file(path: string, filename: string[, comment: string[, flags: number]]) -\u003e ZipWriter\n    add a file to zip.\n\nZipWriter:add_from_zip_reader(src: miniz.ZipReader, idx: number) -\u003e ZipWriter\n    add a file from zip reader to zip.\n\nZipWriter:finalize() -\u003e string\nZipWriter:finalize() -\u003e ZipWriter\nZipWriter:finalize() -\u003e nil, string\n    finalize the write of zip. if zip writer is created from zip_write_string,\n    then the result string is returned; if zip writer is created from\n    zip_write_file, then ZipWriter itself is returned, otherwire a nil and a\n    error message is returned.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwing%2Flua-miniz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarwing%2Flua-miniz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwing%2Flua-miniz/lists"}