Expand description
§Easy to use fast QRCode generator
More examples can be found on GitHub.
§Converts QRCode
to Unicode
use fast_qr::qr::QRBuilder;
// QRBuilder::new can fail if content is too big for version,
// please check before unwrapping.
let qrcode = QRBuilder::new("https://example.com/")
.build()
.unwrap();
let str = qrcode.to_str(); // .print() exists
println!("{}", str);
§Converts QRCode
to SVG
use fast_qr::convert::{svg::SvgBuilder, Builder, Shape};
use fast_qr::qr::QRBuilder;
// QRBuilder::new can fail if content is too big for version,
// please check before unwrapping.
let qrcode = QRBuilder::new("https://example.com/")
.build()
.unwrap();
let _svg = SvgBuilder::default()
.shape(Shape::RoundedSquare)
.to_file(&qrcode, "out.svg");
§Converts QRCode
to an image
use fast_qr::convert::{image::ImageBuilder, Builder, Shape};
use fast_qr::qr::QRBuilder;
// QRBuilder::new can fail if content is too big for version,
// please check before unwrapping.
let qrcode = QRBuilder::new("https://example.com/")
.build()
.unwrap();
let _img = ImageBuilder::default()
.shape(Shape::RoundedSquare)
.background_color([255, 255, 255, 0]) // transparency
.fit_width(600)
.to_file(&qrcode, "out.png");
Re-exports§
Modules§
- Converts a
crate::QRCode
to image or SVG you will need to activate associated feature flag - Module
qr
is the entrypoint to start makingQRCodes
Structs§
- Module is a single pixel in the QR code. Module uses u8 to store value and type.
Enums§
- Error Correction Coding has 4 levels
- The different mask patterns. The mask pattern should only be applied to the data and error correction portion of the QR code.
- Module is a single pixel in the QR code.
- Enum containing all possible
QRCode
versions