{"id":21586112,"url":"https://github.com/magiclen/qrcode-generator","last_synced_at":"2025-04-06T07:16:00.132Z","repository":{"id":47533579,"uuid":"154606492","full_name":"magiclen/qrcode-generator","owner":"magiclen","description":"Generate QR Code matrices and images in RAW, PNG and SVG formats.","archived":false,"fork":false,"pushed_at":"2023-09-09T13:59:29.000Z","size":63,"stargazers_count":60,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-03T04:47:50.217Z","etag":null,"topics":["qrcode","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/magiclen.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":"2018-10-25T03:44:32.000Z","updated_at":"2024-06-19T17:10:15.077Z","dependencies_parsed_at":"2024-06-19T17:10:13.967Z","dependency_job_id":"536a7bd7-05a1-4e9d-8e05-770b43ecd2ae","html_url":"https://github.com/magiclen/qrcode-generator","commit_stats":{"total_commits":56,"total_committers":3,"mean_commits":"18.666666666666668","dds":0.0357142857142857,"last_synced_commit":"89b426d12f5815da8297fa9493974fb33c3cc8b4"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fqrcode-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fqrcode-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fqrcode-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclen%2Fqrcode-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclen","download_url":"https://codeload.github.com/magiclen/qrcode-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445682,"owners_count":20939961,"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":["qrcode","rust"],"created_at":"2024-11-24T15:12:43.106Z","updated_at":"2025-04-06T07:16:00.112Z","avatar_url":"https://github.com/magiclen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"QR Code Generator\n====================\n\n[![CI](https://github.com/magiclen/qrcode-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/qrcode-generator/actions/workflows/ci.yml)\n\nThis crate provides functions to generate QR Code matrices and images in RAW, PNG and SVG formats.\n\n## Examples\n\n#### Encode any data to a QR Code matrix which is `Vec\u003cVec\u003cbool\u003e\u003e`.\n\n```rust\nuse qrcode_generator::QrCodeEcc;\n\nlet result: Vec\u003cVec\u003cbool\u003e\u003e = qrcode_generator::to_matrix(\"Hello world!\", QrCodeEcc::Low).unwrap();\n\nprintln!(\"{:?}\", result);\n```\n\n#### Encode any data to a PNG image stored in a Vec instance.\n\n```rust\nuse qrcode_generator::QrCodeEcc;\n\nlet result: Vec\u003cu8\u003e = qrcode_generator::to_png_to_vec(\"Hello world!\", QrCodeEcc::Low, 1024).unwrap();\n\nprintln!(\"{:?}\", result);\n```\n\n#### Encode any data to a PNG image stored in a file.\n\n```rust\nuse qrcode_generator::QrCodeEcc;\n\nqrcode_generator::to_png_to_file(\"Hello world!\", QrCodeEcc::Low, 1024, \"tests/data/file_output.png\").unwrap();\n```\n\n#### Encode any data to a SVG image stored in a String instance.\n\n```rust\nuse qrcode_generator::QrCodeEcc;\n\nlet result: String = qrcode_generator::to_svg_to_string(\"Hello world!\", QrCodeEcc::Low, 1024, None::\u003c\u0026str\u003e).unwrap();\n\nprintln!(\"{:?}\", result);\n```\n\n#### Encode any data to a SVG image stored in a file.\n\n```rust\nuse qrcode_generator::QrCodeEcc;\n\nqrcode_generator::to_svg_to_file(\"Hello world!\", QrCodeEcc::Low, 1024, None::\u003c\u0026str\u003e, \"tests/data/file_output.svg\").unwrap();\n```\n\n## Low-level Usage\n\n### Raw Image Data\n\nThe `to_image` and `to_image_buffer` functions can be used, if you want to modify your image.\n\n### Segments\n\nEvery `to_*` function has a corresponding `_from_segments` function. You can concatenate segments by using different encoding methods, such as **numeric**, **alphanumeric** or **binary** to reduce the size (level) of your QR code matrix/image.\n\n```rust\nuse qrcode_generator::{QrCodeEcc, QrSegment};\n\nlet first = \"1234567\";\n\nlet second = \"ABCDEFG\";\n\nlet segments = [QrSegment::make_numeric(\u0026first), QrSegment::make_alphanumeric(\u0026second)];\n\nlet result: Vec\u003cVec\u003cbool\u003e\u003e = qrcode_generator::to_matrix_from_segments(\u0026segments, QrCodeEcc::Low).unwrap();\n\nprintln!(\"{:?}\", result);\n```\n\nMore segments optimization apporaches: [magiclen/qrcode-segments-optimizer](https://github.com/magiclen/qrcode-segments-optimizer)\n\n## Crates.io\n\nhttps://crates.io/crates/qrcode-generator\n\n## Documentation\n\nhttps://docs.rs/qrcode-generator\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fqrcode-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclen%2Fqrcode-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclen%2Fqrcode-generator/lists"}