{"id":17559851,"url":"https://github.com/piglig/go-qr","last_synced_at":"2025-04-16T01:23:25.388Z","repository":{"id":177517605,"uuid":"660046380","full_name":"piglig/go-qr","owner":"piglig","description":"A native, high-quality and minimalistic QR code generator","archived":false,"fork":false,"pushed_at":"2024-12-16T06:29:14.000Z","size":258,"stargazers_count":37,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-29T03:23:13.643Z","etag":null,"topics":["go","golang","qr","qr-code","qr-generator","qrcode","qrcode-generator"],"latest_commit_sha":null,"homepage":"","language":"Go","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/piglig.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":"2023-06-29T06:05:45.000Z","updated_at":"2025-03-12T12:31:59.000Z","dependencies_parsed_at":"2024-08-20T09:06:33.745Z","dependency_job_id":null,"html_url":"https://github.com/piglig/go-qr","commit_stats":{"total_commits":94,"total_committers":3,"mean_commits":"31.333333333333332","dds":"0.021276595744680882","last_synced_commit":"d3ece8d8e9f87694ea7e49025124560ab3767158"},"previous_names":["piglig/go-qr"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-qr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-qr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-qr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piglig%2Fgo-qr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piglig","download_url":"https://codeload.github.com/piglig/go-qr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249179675,"owners_count":21225583,"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":["go","golang","qr","qr-code","qr-generator","qrcode","qrcode-generator"],"created_at":"2024-10-21T11:07:58.983Z","updated_at":"2025-04-16T01:23:25.358Z","avatar_url":"https://github.com/piglig.png","language":"Go","funding_links":[],"categories":["Utilities","公用事业公司"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"readme":"# go-qr\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#utilities)\n[![Go Report Card](https://goreportcard.com/badge/github.com/piglig/go-qr)](https://goreportcard.com/report/github.com/piglig/go-qr)\n[![Build Status](https://github.com/piglig/go-qr/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/piglig/go-qr/actions/workflows/go.yml?query=branch%3Amain)\n[![Codecov](https://img.shields.io/codecov/c/github/piglig/go-qr)](https://app.codecov.io/github/piglig/go-qr)\n[![GoDoc](https://godoc.org/github.com/piglig/go-qr?status.svg)](https://pkg.go.dev/github.com/piglig/go-qr)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/piglig/go-qr/blob/main/LICENSE)\n\n\u003e 🎶 Go Community Minimalist QR Code Generator Library.\n\n## Overview\nThis library is native, high quality and minimalistic. Generate QR code from string text\n \nIt is mostly a translation of [project Nayuki's Java version of the QR code generator](https://www.nayuki.io/page/qr-code-generator-library).\n\n## Features\n* Minimalist native code implementation\n* Based on QR Code Model 2 standard, supports all 40 versions and all 4 error correction levels\n* Output format: Raw modules/pixels of the QR symbol\n* Detects finder-like penalty patterns more accurately than other implementations\n* Encoding space optimisation for numeric and special alphanumeric texts\n* Japanese Unicode Text Encoding Optimisation\n* For mixed numeric/alphanumeric/general/kanji text, computes optimal segment mode switching\n* Good test coverage\n* MIT's Open Source License\n\n## Installation\n```go\ngo get github.com/piglig/go-qr\n```\n\n## [Examples](https://github.com/piglig/go-qr/tree/master/example/main.go)\n```go\npackage main\n\nimport (\n\tgo_qr \"github.com/piglig/go-qr\"\n\t\"image/color\"\n)\n\nfunc main() {\n\tdoBasicDemo()\n}\n\nfunc doBasicDemo() {\n\ttext := \"Hello, world!\"\n\terrCorLvl := go_qr.Low\n\tqr, err := go_qr.EncodeText(text, errCorLvl)\n\tif err != nil {\n\t\treturn\n\t}\n\tconfig := go_qr.NewQrCodeImgConfig(10, 4)\n\terr = qr.PNG(config, \"hello-world-QR.png\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = qr.SVG(config, \"hello-world-QR.svg\", \"#FFFFFF\", \"#000000\")\n\tif err != nil {\n\t\treturn\n\t}\n\n\terr = qr.SVG(go_qr.NewQrCodeImgConfig(10, 4, go_qr.WithSVGXMLHeader(true)), \"hello-world-QR-xml-header.svg\", \"#FFFFFF\", \"#000000\")\n\tif err != nil {\n\t\treturn\n\t}\n}\n```\n\n## Command Line Tool\n**generator** command line tool to generate the QR Code.\n### Installation\nIn order to use the tool, compile it using the following command\n```shell\ngo install github.com/piglig/go-qr/tools/generator@latest\n```\n\n### Usage\n```shell\ngenerator [options] [arguments]\n  -content string\n        Content to encode in the QR code\n  -png string\n        Output PNG file name\n  -svg string\n        Output SVG file name\n  -svg-optimized\n        Output optimized SVG file name - regions with connected black pixels are merged into a single path\n```\n\n### Example\n* **Text Art**\n```shell\ngenerator -content hello\n```\n![Gif](./docs/assets/text_art.gif)\n\n* **Image Type**\n```shell\ngenerator -content hello -png hello.png -svg hello.svg\n```\n![Gif](./docs/assets/image_type.gif)\n\n* **Optimized SVG Type**\n```shell\ngenerator -content hello -svg hello.svg -svg-optimized hello-optimized.svg \n```\nThe optimized svg output create paths around connected black regions. This reduces the file size and rendering artifacts.\n![svg](./docs/assets/optimized_path.svg)\n\n## License\nSee the [LICENSE](LICENSE) file for license rights and limitations (MIT).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiglig%2Fgo-qr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiglig%2Fgo-qr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiglig%2Fgo-qr/lists"}