{"id":16800717,"url":"https://github.com/houseme/qrcode-rs","last_synced_at":"2025-03-22T02:31:04.164Z","repository":{"id":64588774,"uuid":"576811088","full_name":"houseme/qrcode-rs","owner":"houseme","description":"QR code encoder in Rust，Generate QR Code matrices and images in RAW, PNG and SVG formats.","archived":false,"fork":false,"pushed_at":"2024-10-16T05:12:37.000Z","size":106,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-01T11:44:40.717Z","etag":null,"topics":["encoder","encoder-decoder","qrcode","qrcode-generator","rust","rust-lang","rust-library"],"latest_commit_sha":null,"homepage":"https://houseme.github.io/qrcode-rs/","language":"Rust","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/houseme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"houseme","issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/houseme"]}},"created_at":"2022-12-11T03:40:17.000Z","updated_at":"2024-10-16T05:12:41.000Z","dependencies_parsed_at":"2024-09-06T12:31:46.048Z","dependency_job_id":"87372292-ee28-4dd9-b4d5-14efa1a8d54c","html_url":"https://github.com/houseme/qrcode-rs","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":"0.17647058823529416","last_synced_commit":"af9e5e104d4003065bfccf8f90a5d8a1da234635"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fqrcode-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fqrcode-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fqrcode-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houseme%2Fqrcode-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houseme","download_url":"https://codeload.github.com/houseme/qrcode-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173520,"owners_count":20410298,"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":["encoder","encoder-decoder","qrcode","qrcode-generator","rust","rust-lang","rust-library"],"created_at":"2024-10-13T09:34:48.586Z","updated_at":"2025-03-22T02:31:03.872Z","avatar_url":"https://github.com/houseme.png","language":"Rust","funding_links":["https://liberapay.com/houseme","https://paypal.me/houseme"],"categories":[],"sub_categories":[],"readme":"Qrcode-rs\n===========\n\n[![Build](https://github.com/houseme/qrcode-rs/workflows/Build/badge.svg)](https://github.com/houseme/qrcode-rs/actions?query=workflow%3ABuild)\n[![crates.io](https://img.shields.io/crates/v/qrcode-rs.svg)](https://crates.io/crates/qrcode-rs)\n[![docs.rs](https://docs.rs/qrcode-rs/badge.svg)](https://docs.rs/qrcode-rs/)\n[![License](https://img.shields.io/crates/l/qrcode-rs)](./LICENSE-APACHE)\n[![Crates.io](https://img.shields.io/crates/d/qrcode-rs)](https://crates.io/crates/qrcode-rs)\n\nQR code and Micro QR code encoder in Rust. [Documentation](https://docs.rs/qrcode-rs).\n\n\nCargo.toml\n----------\n\n```toml\n[dependencies]\nqrcode-rs = \"0.1\"\n```\n\nThe default settings will depend on the `image` crate. If you don't need image generation capability, disable the `default-features`:\n\n```toml\n[dependencies]\nqrcode-rs = { version = \"0.1\", default-features = false }\n```\n\nExample\n-------\n\n## Image generation\n\n```rust\nuse qrcode_rs::QrCode;\nuse image::Luma;\n\nfn main() {\n    // Encode some data into bits.\n    let code = QrCode::new(b\"01234567\").unwrap();\n\n    // Render the bits into an image.\n    let image = code.render::\u003cLuma\u003cu8\u003e\u003e().build();\n\n    // Save the image.\n    image.save(\"/tmp/qrcode.png\").unwrap();\n}\n```\n\nGenerates this image:\n\n![Output](docs/images/test_annex_i_qr_as_image.png)\n\n## String generation\n\n```rust\nuse qrcode_rs::QrCode;\n\nfn main() {\n    let code = QrCode::new(b\"Hello\").unwrap();\n    let string = code.render::\u003cchar\u003e()\n        .quiet_zone(false)\n        .module_dimensions(2, 1)\n        .build();\n    println!(\"{}\", string);\n}\n```\n\nGenerates this output:\n\n```none\n##############    ########  ##############\n##          ##          ##  ##          ##\n##  ######  ##  ##  ##  ##  ##  ######  ##\n##  ######  ##  ##  ##      ##  ######  ##\n##  ######  ##  ####    ##  ##  ######  ##\n##          ##  ####  ##    ##          ##\n##############  ##  ##  ##  ##############\n                ##  ##\n##  ##########    ##  ##    ##########\n      ##        ##    ########    ####  ##\n    ##########    ####  ##  ####  ######\n    ##    ##  ####  ##########    ####\n  ######    ##########  ##    ##        ##\n                ##      ##    ##  ##\n##############    ##  ##  ##    ##  ####\n##          ##  ##  ##        ##########\n##  ######  ##  ##    ##  ##    ##    ##\n##  ######  ##  ####  ##########  ##\n##  ######  ##  ####    ##  ####    ##\n##          ##    ##  ########  ######\n##############  ####    ##      ##    ##\n```\n\n## SVG generation\n\n```rust\nuse qrcode_rs::{QrCode, Version, EcLevel};\nuse qrcode_rs::render::svg;\n\nfn main() {\n    let code = QrCode::with_version(b\"01234567\", Version::Micro(2), EcLevel::L).unwrap();\n    let image = code.render()\n        .min_dimensions(200, 200)\n        .dark_color(svg::Color(\"#800000\"))\n        .light_color(svg::Color(\"#ffff80\"))\n        .build();\n    println!(\"{}\", image);\n}\n```\n\nGenerates this SVG:\n\n[![Output](docs/images/test_annex_i_micro_qr_as_svg.svg)](docs/images/test_annex_i_micro_qr_as_svg.svg)\n\n## Unicode string generation\n\n```rust\nuse qrcode_rs::QrCode;\nuse qrcode_rs::render::unicode;\n\nfn main() {\n    let code = QrCode::new(\"mow mow\").unwrap();\n    let image = code.render::\u003cunicode::Dense1x2\u003e()\n        .dark_color(unicode::Dense1x2::Light)\n        .light_color(unicode::Dense1x2::Dark)\n        .build();\n    println!(\"{}\", image);\n}\n```\n\nGenerates this output:\n\n```text\n█████████████████████████████\n█████████████████████████████\n████ ▄▄▄▄▄ █ ▀▀▀▄█ ▄▄▄▄▄ ████\n████ █   █ █▀ ▀ ▀█ █   █ ████\n████ █▄▄▄█ ██▄  ▀█ █▄▄▄█ ████\n████▄▄▄▄▄▄▄█ ▀▄▀ █▄▄▄▄▄▄▄████\n████▄▀ ▄▀ ▄ █▄█  ▀ ▀█ █▄ ████\n████▄██▄▄▀▄▄▀█▄ ██▀▀█▀▄▄▄████\n█████▄▄▄█▄▄█  ▀▀▄█▀▀▀▄█▄▄████\n████ ▄▄▄▄▄ █   ▄▄██▄ ▄ ▀▀████\n████ █   █ █▀▄▄▀▄▄ ▄▄▄▄ ▄████\n████ █▄▄▄█ █▄  █▄▀▄▀██▄█▀████\n████▄▄▄▄▄▄▄█▄████▄█▄██▄██████\n█████████████████████████████\n▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\n```\n\n## License\nLicensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n\n### Thanks to [Kennytm](https://github.com/kennytm), this package is based on [`qrcode-rust`](https://github.com/kennytm/qrcode-rust).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Fqrcode-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhouseme%2Fqrcode-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhouseme%2Fqrcode-rs/lists"}