How to use qrcode - 10 common examples

To help you get started, we’ve selected a few qrcode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mymonero / mymonero-app-js / local_modules / RequestFunds / Models / FundsRequest.js View on Github external
_new_qrCode_imgDataURIString(fn)
	{
		const self = this
		const fundsRequestURI = self._assumingBootedOrEquivalent__Lazy_URI__addressAsFirstPathComponent() // NOTE: creating QR code with URI w/o "//" - wider scanning support in ecosystem
		// ^- since we're not booted yet but we're only calling this when we know we have all the info
		const options = { errorCorrectionLevel: 'Q' } // Q: quartile: 25%
		QRCode.toDataURL(
			fundsRequestURI, 
			options,
			function(err, imgDataURIString)
			{
				if (err) {
					console.error("Error generating QR code:", err)
				}
				fn(err, imgDataURIString)
			}
		)
	}
github open-xml-templating / docxtemplater / examples / jsqrcode.html View on Github external
}

DocUtils.loadDoc('qrcode.png',true

                 )
// rea= new FileReader();     
// rea.onload = function(theFile) {
//             console.log(5)
//             qrcode.callback(function(a){console.log(this);console.log(a)});
//             qrcode.decode(e.target.result);
//         };
// rea.readAsText(docXData['qrcode.png'])

console.log(docXData['qrcode.png'])

la=b64toBlob(docXData['qrcode.png'],"image/png")
github open-xml-templating / docxtemplater / examples / jsqrcode.html View on Github external
var blob = new Blob(byteArrays, {type: contentType});
    return blob;
}

DocUtils.loadDoc('qrcode.png',true

                 )
// rea= new FileReader();     
// rea.onload = function(theFile) {
//             console.log(5)
//             qrcode.callback(function(a){console.log(this);console.log(a)});
//             qrcode.decode(e.target.result);
//         };
// rea.readAsText(docXData['qrcode.png'])

console.log(docXData['qrcode.png'])

la=b64toBlob(docXData['qrcode.png'],"image/png")
github LedgerHQ / ledger-live-desktop / src / components / base / QRCode / index.js View on Github external
drawQRCode() {
    const { data, size, errorCorrectionLevel } = this.props
    const { current } = this.canvas
    if (!current) return
    qrcode.toCanvas(
      current,
      data,
      {
        width: current.width,
        margin: 0,
        errorCorrectionLevel,
      },
      () => {
        // fix again the CSS because lib changes it –_–
        current.style.width = `${size}px`
        current.style.height = `${size}px`
      },
    )
  }
github TheEssem / esmBot-legacy / commands / qrcreate.js View on Github external
exports.run = async (client, message, args) => { // eslint-disable-line no-unused-vars
  const qrOutput = tempy.file({ extension: "png" });
  message.channel.startTyping();
  if (args.length > 0) {
    qrcode.toFile(qrOutput, args.join(" "), { margin: 1 }, (error) => {
      if (error) throw new Error(error);
      message.channel.stopTyping();
      message.channel.send({
        files: [{
          attachment: qrOutput,
          name: "qr.png"
        }]
      });
    });
  } else {
    message.channel.stopTyping();
    message.reply("you need to provide some text to generate a QR code!");
  }
};
github CityOfZion / neon-wallet / app / modules / nep9 / Nep9QrGenerator.js View on Github external
new Promise((resolve, reject) => {
        QRCode.toCanvas(
          // $FlowFixMe
          this.uri,
          options,
          (err, canvas) => (err ? reject(err) : resolve(canvas)),
        )
      }),
    ])
github Moddable-OpenSource / moddable / examples / data / qrcode / main.js View on Github external
*
 *   This file is part of the Moddable SDK.
 *
 *   This work is licensed under the
 *       Creative Commons Attribution 4.0 International License.
 *   To view a copy of this license, visit
 *       .
 *   or send a letter to Creative Commons, PO Box 1866,
 *   Mountain View, CA 94042, USA.
 *
 */
import qrCode from "qrcode";
import Poco from "commodetto/Poco";

// generate QR code
let qr = qrCode({input: "Welcome to Moddable", maxVersion: 4});
let size = qr.size;
qr = new Uint8Array(qr);

// trace QR code to console
for (let y = 0; y < size; y++) {
	for (let x = 0; x < size; x++) {
		if (qr[(y * size) + x])
			trace("X");
		else
			trace(".");
	}
	trace("\n");
}

// render QR code to screen
let render = new Poco(screen);
github fengyuanchen / vue-qrcode / src / index.js View on Github external
generate() {
      const { options, tag } = this;
      const value = String(this.value);

      if (tag === 'canvas') {
        QRCode.toCanvas(this.$el, value, options, (error) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }
        });
      } else if (tag === 'img') {
        QRCode.toDataURL(value, options, (error, url) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }

          this.$el.src = url;
        });
      } else {
        QRCode.toString(value, options, (error, string) => {
github fengyuanchen / vue-qrcode / src / index.js View on Github external
generate() {
      const { options, tag } = this;
      const value = String(this.value);

      if (tag === 'canvas') {
        QRCode.toCanvas(this.$el, value, options, (error) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }
        });
      } else if (tag === 'img') {
        QRCode.toDataURL(value, options, (error, url) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }

          this.$el.src = url;
        });
      } else {
        QRCode.toString(value, options, (error, string) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }

          this.$el.innerHTML = string;
        });
github fengyuanchen / vue-qrcode / src / index.js View on Github external
/* istanbul ignore if */
          if (error) {
            throw error;
          }
        });
      } else if (tag === 'img') {
        QRCode.toDataURL(value, options, (error, url) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }

          this.$el.src = url;
        });
      } else {
        QRCode.toString(value, options, (error, string) => {
          /* istanbul ignore if */
          if (error) {
            throw error;
          }

          this.$el.innerHTML = string;
        });
      }
    },
  },