{"id":15714154,"url":"https://github.com/nbw/qrusty","last_synced_at":"2026-03-08T10:32:21.644Z","repository":{"id":39607729,"uuid":"493242167","full_name":"nbw/qrusty","owner":"nbw","description":"Elixir QR Code library that leverages precompiled Rust","archived":false,"fork":false,"pushed_at":"2022-11-29T12:47:53.000Z","size":94,"stargazers_count":31,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T06:45:25.240Z","etag":null,"topics":["elixir","qrcode","rust"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/qrusty","language":"Elixir","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/nbw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-05-17T12:30:40.000Z","updated_at":"2024-12-25T20:01:30.000Z","dependencies_parsed_at":"2023-01-21T02:46:09.648Z","dependency_job_id":null,"html_url":"https://github.com/nbw/qrusty","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/nbw/qrusty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbw%2Fqrusty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbw%2Fqrusty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbw%2Fqrusty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbw%2Fqrusty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nbw","download_url":"https://codeload.github.com/nbw/qrusty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nbw%2Fqrusty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30253702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T08:59:44.879Z","status":"ssl_error","status_checked_at":"2026-03-08T08:58:02.867Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["elixir","qrcode","rust"],"created_at":"2024-10-03T21:34:53.924Z","updated_at":"2026-03-08T10:32:21.603Z","avatar_url":"https://github.com/nbw.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qrusty\n\nQR Code generator that leverages [precompiled Rust](https://github.com/philss/rustler_precompiled).\n\nThe \"precompiled\" implies that using this library does not require installing Rust.\n\n## Installation\n\nThe package can be installed by adding `qrusty` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:qrusty, \"~\u003e 0.1.4\"}\n  ]\nend\n```\n\n## Usage\n\n[Qrusty documentation](https://hexdocs.pm/qrusty/Qrusty.html).\n\nThe following QR formats are supported:\n\n- SVG (`:svg`)\n- PNG (`:png`)\n- JPG (`:jpg`)\n- base64 PNG (`:png64`)\n- base64 JPG (`:jpg64`)\n\n### Options\n\n- width: width in pixels (default: 200)\n- height: height in pixels (default: 200)\n- size: shorthand for width and height (default: 200)\n- ec: [error correction level](https://docs.rs/qrcode/0.6.0/qrcode/types/enum.EcLevel.html#variants) `:l`, `:m`, `:q`, `:h` (default: :m)\n\n### SVG\n\n```elixir\n\u003e {:ok, %Qrusty.QR{encoded_data: svg}} = Qrusty.qr(\"https://elixir-lang.org/\", :svg, size: 200)\n\nFile.write(\"./assets/qr.svg\", svg)\n```\n\n### PNG/JPG\n\n```elixir\n\u003e {:ok, %Qrusty.QR{encoded_data: binary}} = Qrusty.qr(\"https://elixir-lang.org/\", :png, width: 200, height: 200)\n\nFile.write(\"./assets/qr.png\", binary)\n\n\u003e {:ok, %Qrusty.QR{encoded_data: binary}} = Qrusty.qr(\"https://elixir-lang.org/\", :jpg, width: 200, height: 200)\n\nFile.write(\"./assets/qr.jpg\", binary)\n```\n\n### Base64 PNG/JPG\n\n```elixir\n# :png64 or :jpg64\n\u003e {:ok, %Qrusty.QR{encoded_data: binary_64}} = Qrusty.qr(\"https://elixir-lang.org/\", :png64, width: 200, height: 200)\n\n# Heex Template (for example)\n\u003ca href={\"data:image/png;base64, \" \u003c\u003e binary_64} download=\"qr.png\"\u003e\n  \u003cimg src={\"data:image/png;base64, \"\u003c\u003e binary_64}\u003e\u003c/img\u003e\n\u003c/a\u003e\n```\n\n| Format | Sample                         |\n| ------ | ------------------------------ |\n| SVG    | ![ svg ](assets/qr.svg)        |\n| PNG    | ![ png ](assets/qr.png)        |\n| JPG    | ![ jpg ](assets/qr.jpg)        |\n| PNG64  | [ sample ](assets/base65.html) |\n| JPG64  | --                             |\n\nError correction:\n\n| L                          | M                          | Q                          | H                          |\n| -------------------------- | -------------------------- | -------------------------- | -------------------------- |\n| ![ l ](assets/qr_ec_l.jpg) | ![ m ](assets/qr_ec_m.jpg) | ![ q ](assets/qr_ec_q.jpg) | ![ h ](assets/qr_ec_h.jpg) |\n\n## Benchmarks\n\nBenchmarks have been included to compare Qrusty (Rust based) against other Elixir based QR libraries. Specifically [EQRCode](https://github.com/SiliconJungles/eqrcode) (SVG, PNG), and [QRCode](https://github.com/iodevs/qr_code) (SVG only).\n\n**Note**: since the execution time of generating a single QR code is so fast, benchmarking was not very accurate. To compensate, **the benchmarks measure the execution time for generating 100 QR codes.**\n\n### Usage\n\nRun the following:\n\n```\nmix run benchmarks/png.exs\nmix run benchmarks/svg.exs\n...\n```\n\n### Summary\n\nThe full results are [here](/BENCHMARKS.md).\n\n_Qrusty vs EQRCode (x times faster)_\n\n|     | 100x100 | 200x200 | 500x500 |\n| --- | ------- | ------- | ------- |\n| PNG | 27.43x  | 18.86x  | 7.21x   |\n| SVG | 42.46x  | 42.70x  | 42.72x  |\n| JPG | -       | -       | -       |\n\nTrends: QRusty executes faster than QRCode, but the gains decrease with larger image sizes.\n\n_Qrusty vs QRCode (x times faster)_\n\n|     | 100x100 | 200x200 | 500x500 |\n| --- | ------- | ------- | ------- |\n| PNG | -       | -       | -       |\n| SVG | 11.87x  | 11.78x  | 12.02x  |\n| JPG | -       | -       | -       |\n\n[1]: saving PNG would require [Mogrify](https://github.com/elixir-mogrify/mogrify), which requires installing ImageMagick.\n\n[2]: QRCode doesn't take a size/width/height param so it's safe to say ≈ 11.8x\n\n## Development\n\nYou will need the following installed:\n\n- Elixir\n- Rust\n- [Cross](https://github.com/cross-rs/cross)\n\n1. Increment the version in mix.exs so that the build on github can no longer be found\n2. Compile locally: `mix compile.local` or `QRUSTY_BUILD=true iex -S mix`\n\n## Contributions\n\nContributions are welcome.\n\n### Rust Contribution Rules\n\n- The Rust layer should be as thin as possible\n- The Rust layer should not deal with errors caused by human input (ex: invalid input args). Deal with interface errors in Elixir\n- Default values, etc. should all be handled on the Elixir side\n\nBasically, the end user is an Elixir developer, so keep as much code as possible in Elixir for readability. Leverage Rust only for its performance benefits/access to system level libraries, etc. 🙏\n\n# Thanks\n\n- Thanks to kennytm for [qrcode-rust](https://github.com/kennytm/qrcode-rust)\n- Thanks to qm3ster for [this PR](https://github.com/qm3ster/qrcode-rust) to support image v0.24\n- Thanks to the creators of [EQRCode](https://github.com/SiliconJungles/eqrcode)\n\n# Copyright and License\n\nThis library is released under the MIT License. See the [LICENSE.md](/LICENSE.md) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbw%2Fqrusty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnbw%2Fqrusty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnbw%2Fqrusty/lists"}