{"id":40903941,"url":"https://github.com/pashifika/compress","last_synced_at":"2026-01-22T02:36:19.631Z","repository":{"id":57651098,"uuid":"448716080","full_name":"pashifika/compress","owner":"pashifika","description":"a go compress library for fs.FS interface","archived":false,"fork":false,"pushed_at":"2022-01-17T05:34:24.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T11:51:59.824Z","etag":null,"topics":["archiver","go","golang","rar","zip"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pashifika.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}},"created_at":"2022-01-17T01:16:25.000Z","updated_at":"2022-08-01T06:58:42.000Z","dependencies_parsed_at":"2022-09-05T13:41:46.380Z","dependency_job_id":null,"html_url":"https://github.com/pashifika/compress","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pashifika/compress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashifika%2Fcompress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashifika%2Fcompress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashifika%2Fcompress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashifika%2Fcompress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pashifika","download_url":"https://codeload.github.com/pashifika/compress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pashifika%2Fcompress/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28651809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["archiver","go","golang","rar","zip"],"created_at":"2026-01-22T02:36:19.568Z","updated_at":"2026-01-22T02:36:19.624Z","avatar_url":"https://github.com/pashifika.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"compress: a go compress library for fs.FS interface\n===================================================\n\n\n| Format | Test  | Charset | Decoder | Encoder | Password | Info                                                                                           |\n|--------|-------|---------|---------|---------|----------|------------------------------------------------------------------------------------------------|\n| zip    | local | true    | true    | true    | false    | used go std                                                                                    |\n| rar    | local | false   | true    | false   | true     | [rardecode/v2](http://github.com/nwaples/rardecode)                                            |\n| 7zip   | false | false   | true    | false   | true     | not work in big file(\u003e10M)\u003cbr/\u003egithub.com/ulikunitz/xz/lzma.(*rangeDecoder).DecodeBit too slow |\n\n\n\n\n## use\n\n```\ngo get github.com/pashifika/compress\n```\n\nExample:\n--------\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log\"\n\n\t\"golang.org/x/text/encoding\"\n\t\"golang.org/x/text/encoding/japanese\"\n\n\t\"github.com/pashifika/compress\"\n\t_ \"github.com/pashifika/compress/rar\"\n\t_ \"github.com/pashifika/compress/zip\"\n)\n\nfunc main() {\n\t// set charset to decode zip header name\n\tfsys := \u0026compress.FileSystem{\n\t\tCharset:     []encoding.Encoding{japanese.ShiftJIS},\n\t\tSkipCharErr: false,\n\t}\n\tpath := \"you test archive file path\"\n\trc, err := fsys.Open(path)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer fsys.Close()\n\n\terr = fs.WalkDir(rc, \".\", func(path string, d fs.DirEntry, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif d.IsDir() {\n\t\t\tswitch path {\n\t\t\tcase \".git\":\n\t\t\t\treturn fs.SkipDir\n\t\t\tcase compress.DefaultArchiverRoot:\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"dir:\", path)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tif !d.IsDir() {\n\t\t\taf, err := rc.Open(path)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tbuf := bytes.Buffer{}\n\t\t\tn, err := io.Copy(\u0026buf, af)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tfmt.Println(\"file:\", path)\n\t\t\tfmt.Println(n, err, n, buf.Len())\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpashifika%2Fcompress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpashifika%2Fcompress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpashifika%2Fcompress/lists"}