Skip to main content

Crate qrcode_rs

Crate qrcode_rs 

Source
Expand description

QRCode encoder

This crate provides a QR code and Micro QR code encoder for binary data.

use qrcode_rs::QrCode;
use image::Luma;

// Encode some data into bits.
let code = QrCode::new(b"01234567").unwrap();

// Render the bits into an image.
let image = code.render::<Luma<u8>>().build();

// Save the image.
image.save("/tmp/qrcode.png").unwrap();

// You can also render it into a string.
let string = code.render()
    .light_color(' ')
    .dark_color('#')
    .build();
println!("{}", string);

Re-exports§

pub use crate::types::Color;
pub use crate::types::EcLevel;
pub use crate::types::QrResult;
pub use crate::types::Version;

Modules§

bits
Bit-level data encoding for QR codes.
canvas
QR code canvas construction and masking.
ec
Reed-Solomon error correction for QR codes.
optimize
Data mode segmentation optimizer.
render
Rendering pipeline for converting QR codes into visual output.
types

Structs§

QrCode
The encoded QR code symbol.