4 releases
0.3.1 | Apr 12, 2022 |
---|---|
0.3.0 | Apr 12, 2022 |
0.2.1 | Apr 8, 2022 |
0.2.0 | Apr 8, 2022 |
#28 in Encoding
120 downloads per month
455KB
10K
SLoC
Fast_QR
fast_qr
generates QRCodes approximately 5-6x faster than qrcode
crate.
This test was done using time
tool and generating 10k QRCodes of version 40.
You can create a QR as
- Raw matrix
- Vectorized image
- Image
Example
use fast_qr::{ECL, Version, QRBuilder};
let qrcode = QRBuilder::new("https://example.com/".into())
.ecl(ECL::H)
.version(Version::V03)
.build();
// It is preferable to check qrcode result before
qrcode.unwrap().print();
Build WASM
wasm-pack build --target web # All ready in ./pkg
Or find a bundled version in the latest release
lib.rs
:
Example
use fast_qr::{ECL, Version, QRBuilder};
let qrcode = QRBuilder::new("https://example.com/".into())
.ecl(ECL::H)
.version(Version::V03)
.build();
// It is preferable to check qrcode result before
qrcode.unwrap().print();
Example SVG
use fast_qr::{ECL, Version, QRBuilder};
let qrcode = QRBuilder::new("https://example.com/".into())
.ecl(ECL::H)
.version(Version::V03)
.build();
let svg = fast_qr::convert::svg::SvgBuilder::new()
.shape(fast_qr::convert::svg::SvgShape::RoundedSquare)
.build_qr(qrcode.unwrap());
println!("{}", svg);
Dependencies
~0.7–1.3MB
~26K SLoC