/qr.248.no

Primary LanguageRustGNU Lesser General Public License v2.1LGPL-2.1

qr.248.no

A simple Rust-based tool and API that allows you to generate QR codes.

A QR code to this repository can be found at https://qr.248.no/qr.png?data=https%3A%2F%2Fgithub.com%2Frosvik%2Fqr.248.no&size=500

How to Use

Setup

cargo run

The API will start running on http://127.0.0.1:2339.

Usage

GET /<FILENAME>?data=<DATA>&size=<PIXELS>

Parameters:

  • data: The data to be encoded in the QR code.
  • size: The width and height of the image in pixels. The generator doesn't usually give a image of the exact size requested, but rounds to a larger size where the "QR pixels" are an even amount of "image pixels". Default: 1000
  • format: The format of the generated image. Supports png, jpg/jpeg, bmp and svg. The format can either be given as a url param, or as file extension to the route name. (/image.jpg or /image?format=jpg) Defaults to png

Example:

curl "http://127.0.0.1:2339/image-name.png?data=https://example.com/&size=300"
248