Analysis updated 2026-05-18
Check a QR code you already generated for an accidental hooked-cross pattern before publishing it.
Generate a QR code that is guaranteed free of the pattern while staying scannable.
Plug detection into an existing QR generation pipeline using qrcodegen, qrcode, or fast_qr.
Add an automated safety check to a QR code generator used by a product or website.
| marc-alexis-com/qr-swastika-avoider | adindazu/ultimatevocal | applicative-systems/gcan | |
|---|---|---|---|
| Stars | 18 | 18 | 18 |
| Language | Rust | Rust | Rust |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | ops devops |
Figures from each repo's GitHub metadata at analysis time.
The default build has zero dependencies, optional cargo features add adapters for specific QR libraries or the safe-generation function.
QR codes are drawn using one of eight interchangeable mask patterns, and the standard picks whichever mask scores best for readability without ever checking what shapes appear in the result. Because of that, a swastika shaped pattern can occasionally appear by chance in a generated QR code, especially in small or thin motifs. This Rust crate exists specifically to catch that problem: it detects when a hooked cross pattern has appeared in a QR code, and it can optionally generate a code that is guaranteed not to contain one. The core detector has no external dependencies and works with any QR code representation through a small two method trait, so it can plug into whatever QR generating library you already use. It is careful to avoid false positives: it excludes the finder, timing, alignment, and format or version sections of a QR code from its scan, so a normal structural corner of the code is never mistaken for the pattern it is looking for, and it also ignores a motif that would be invisible anyway because it blends into same colored modules around it. For detecting an existing code, you pass in the QR code's module grid and get back a true or false answer. Built in adapters exist for the popular qrcodegen, qrcode, and fast_qr Rust crates, plus a raw grid representation, each gated behind its own optional cargo feature so you only pull in what you need. For generating a new code, an optional encode_safe function renders all eight standard masks, filters out any that contain the pattern, and returns the cleanest remaining option, so you still get the same readability optimization the QR standard normally provides, just with the unwanted pattern ruled out or an explicit error if none can be found. The detector's scope is intentionally narrow: it targets the classic axis aligned hooked cross shape at two specific sizes, in both mirror directions and both color polarities, within a small tolerance. Diagonal or rotated versions of the pattern are outside what it currently checks for. The crate is licensed under the MIT license.
A Rust crate that detects accidental swastika-shaped patterns in generated QR codes and can produce a guaranteed clean, still scannable code instead.
Mainly Rust. The stack also includes Rust.
Free to use, modify, and redistribute for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.