1.0.1 • Published 5 years ago

@manufosela/qr-code-generator v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 years ago

QRCode Generator

QRCodeGenerator ES6 class.

Use

const qr = new QRCodeGenerator(typeNumber, errorCorrectLevel);

Where:

  • typeNumber: from 1 to 10

    • qrcode size: 1 to max 14 characters with Low errorCorrectLevel
    • qrcode size: 10 to max 213 characters with Low errorCorrectLevel
  • errorCorrectLevel: it can be:

    • L (Low) => ~7%
    • M (Medium) => ~15%
    • Q (Quartile) => ~25%
    • H (High) => ~30%

Example

  const qr = new QRCodeGenerator(4, 'M');
  const text = "https://manufosela.es";
  qr.addData(text);
  qr.make();
  qrcodeHTML = qr.createImgTag();

  document.querySelector('#qr').innerHTML = qrcodeHTML;