Crate qrcode [] [src]

QRCode encoder

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

extern crate qrcode;
extern crate image;

use qrcode::QrCode;
use image::GrayImage;

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

    // Render the bits into an image.
    let image: GrayImage = code.render().to_image();

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

Reexports

pub use types::QrResult;
pub use types::EcLevel;
pub use types::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.