Crate qrcode [] [src]

QRCode encoder

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

use qrcode::QrCode;

let code = QrCode::new(b"Some content here.");
match code {
    Err(err) => panic!("Failed to encode the QR code: {:?}", err),
    Ok(code) => {
        for y in 0 .. code.width() {
            for x in 0 .. code.width() {
                let color = if code[(x, y)] { "black" } else { "white" };
                // render color at position (x, y)
            }
        }
    }
}

Reexports

pub use types::{QrResult, EcLevel, Version};

Modules

bits

The bits module encodes binary data into raw bits used in a QR code.

canvas

The canvas module puts raw bits into the QR code canvas.

ec

The ec module applies the Reed-Solomon error correction codes.

optimize

Find the optimal data mode sequence to encode a piece of data.

types

Structs

QrCode

The encoded QR code symbol.