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

Download history 84/week @ 2022-04-07 35/week @ 2022-04-14 9/week @ 2022-04-21 25/week @ 2022-04-28 20/week @ 2022-05-05 66/week @ 2022-05-12

120 downloads per month

Custom license

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();
Example qr for website example.com

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