turnley.dev

PHP and MySQL code for faucet operators

Tools & Calculators

Tool

QR code generator

Generate a QR code as an SVG on this server, with nothing sent to an image service — which matters when the payload is a 2FA secret.

Encoded here, on this server, in plain PHP. Nothing is sent to an image service and nothing is stored.

That matters most for the case this was built for: a two-factor enrolment QR contains the shared secret, so generating it through a third-party image API hands that secret to someone else and leaves it in their logs. If you are setting up two-factor on your own site, run the encoder on your own server — the entry in the library has the code and the two bugs that cost a day each.

Output is an SVG, so it stays sharp at any size and you can paste it straight into a page.

Notes

Error correction M is the sensible default. H survives more damage at the cost of a bigger code, which only matters if the code will be printed and handled.

A module size of 4 or 5 pixels is comfortable on screen. For print, scale the SVG rather than raising this — it is vector output.

The quiet zone is included. Cropping it is the most common reason an otherwise perfect code will not scan.

Byte mode, versions 1 to 10, which is up to roughly 270 characters at M. Longer payloads need a URL shortener rather than a bigger code.

Other tools