14 lines
295 B
Rust
14 lines
295 B
Rust
use image::Luma;
|
|
use qrcode::QrCode;
|
|
|
|
fn main() {
|
|
// Encode some data into bits.
|
|
let code = QrCode::new(b"01234567").unwrap();
|
|
|
|
// Render the bits into an image.
|
|
let image = code.render::<Luma<u8>>().build();
|
|
|
|
// Save the image.
|
|
image.save("/tmp/qrcode.png").unwrap();
|
|
}
|