Crate qrcode [] [src]

QRCode encoder

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

extern crate image;
extern crate qrcode;

use image::GrayImage;
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) => {
        let image: GrayImage = code.render().min_width(100).to_image();
        // render `image`...
    }
}

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.

render

Render a QR code into image.

types

Structs

QrCode

The encoded QR code symbol.