qr_code
QR code and Micro QR code encoder in Rust. Documentation.
This lib forked https://docs.rs/qrcode mainly because of lack of support to structured QR code (multiple QR codes) even if the minimal change required has been pushed https://github.com/kennytm/qrcode-rust/pull/44
Moreover dependencies image
, checked_int_cast
and module render
has been removed with a view to simplicity.
Example
Bmp image generation
requires bmp
feature
let qr_code = new.unwrap;
let bmp = qr_code.to_bmp;
bmp.write.unwrap;
Generate this image:
Looks small?
Many context supports rescaling mode specific for pixelated images, for example in html image-rendering: pixelated;
As an alternative see method Bmp::mul
and Bmp::add_whitespace
Unicode string generation
let qr_code = new.unwrap;
println!;
Generates this output (looks better in terminal):
█▀▀▀▀▀█ ▀▀▀█ █▀▀▀▀▀█
█ ███ █ █ █ ▀ █ ███ █
█ ▀▀▀ █ ██ ▄▀ █ ▀▀▀ █
▀▀▀▀▀▀▀ █ █ ▀ ▀▀▀▀▀▀▀
▀ ▀█▀▀▀ ▄▀ █▄▄█▀▀██ ▄
█▀▀█▀▄▄▀█▄█▄█▀ ██▀
▀▀▀ ▀▀█▀▀ █ █ ▄ ▀
█▀▀▀▀▀█ ▄▀▄▀ ▀ ▄█▄██
█ ███ █ █▄ █▄█▄▄▀▄ ▀
█ ▀▀▀ █ ▀█ ▄█▄█▀▄▄█
▀▀▀▀▀▀▀ ▀▀ ▀ ▀ ▀