Find a file
2017-01-27 01:03:48 +08:00
src Incorporate README example directly into doc test. 2017-01-27 01:02:34 +08:00
.gitignore Enable coveralls. 2016-05-14 23:43:38 +08:00
.travis.yml Some dependencies needed the ? operator -.-. 2017-01-13 11:27:57 +08:00
Cargo.toml Exclude test-data/ for now... 2017-01-27 01:03:48 +08:00
LICENSE-APACHE.txt Relicense as Apache-2 + MIT. 2016-06-08 00:30:47 +08:00
LICENSE-MIT.txt Relicense as Apache-2 + MIT. 2016-06-08 00:30:47 +08:00
README.md Incorporate README example directly into doc test. 2017-01-27 01:02:34 +08:00

qrcode-rust

Build status Coverage Status crates.io MIT / Apache 2.0

QR code and Micro QR code encoder in Rust. Documentation.

Cargo.toml

[dependencies]
qrcode = "0.2.0"

The default settings will depend on the image crate. If you don't need image generation capability, disable the default-features:

[dependencies]
qrcode = { version = "0.2.0", default-features = false }

Example

This code:

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();
}

Generates this image:

Output