src | ||
.gitignore | ||
.travis.yml | ||
Cargo.toml | ||
LICENSE-APACHE.txt | ||
LICENSE-MIT.txt | ||
README.md |
qrcode-rust
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: