Go to file
2017-05-23 06:56:22 +08:00
src Refactor Renderer to support rendering to String. 2017-05-23 06:56:22 +08:00
.gitignore Enable coveralls. 2016-05-14 23:43:38 +08:00
.travis.yml Improve Travis. 2017-05-23 06:56:22 +08:00
Cargo.toml Remove num-traits dependency. 2017-05-23 06:56:22 +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 Change all bool type to explicit Color type. 2017-05-23 06:56:22 +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.4"

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.4", 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