Find a file
2016-06-08 00:45:54 +08:00
src Support image generation. 2016-06-08 00:31:11 +08:00
.gitignore Enable coveralls. 2016-05-14 23:43:38 +08:00
.travis.yml Make nightly-i686 failable due to travis env problem. 2016-06-08 00:45:54 +08:00
Cargo.toml Support image generation. 2016-06-08 00:31:11 +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 Support image generation. 2016-06-08 00:31:11 +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