How to use the qrcode-terminal.setErrorLevel function in qrcode-terminal

To help you get started, we’ve selected a few qrcode-terminal 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 OAuth3 / oauth3-cli / bin / cli.js View on Github external
);
  // TODO minimal option to exclude these defaults
  url = url
    .replace(/issuer=([^&]*)&?/, '')
    .replace(/digits=6&?/, '')
    .replace(/algorithm=SHA1&?/, '')
    .replace(/period=30&?/, '')
    .replace(/(&|\?)$/, '')
    ;
  state.state = 'qr';
  state.msgs = [
    "Create a New Account" + (state.totpRetry && (" (Take #" + (state.totpRetry + 1) + ")") || '')
  , ""
  ];

  qrcode.setErrorLevel('L'); // L: 7%, M: 15%, Q: 25%, H: 30%
  qrcode.generate(url, function (qr) {
    state.qr = qr;
    state.msgs.push('__RAW__');
  });

  state.msgs.push('');
  state.msgs.push("Download the Authy App at https://www.authy.com/app/");
  state.msgs.push('');
  state.msgs.push(url);
  state.msgs.push('');
  state.msgs.push("Type the 6-digit token below:");

  state.error = null;
  state.prompt = '6-digit Token: ';

  // TODO handle token as 000000 with delimeters '-', ' ', or '.'
github OAuth3 / oauth3-cli / lib / cli.js View on Github external
// TODO minimal option to exclude these defaults
  url = url
    .replace(/issuer=([^&]*)&?/, '')
    .replace(/digits=6&?/, '')
    .replace(/algorithm=SHA1&?/, '')
    .replace(/period=30&?/, '')
    .replace(/(&|\?)$/, '')
    ;
  state.state = 'qr';
  state.msgs = [
    (state.totpRetry && ("[Take #" + (state.totpRetry + 1) + "] ") || '')
  + "Create New Account: Add Multi-Factor Authentication (2FA/MF1)"
  , ""
  ];

  qrcode.setErrorLevel('L'); // L: 7%, M: 15%, Q: 25%, H: 30%
  qrcode.generate(url, function (qr) {
    state.qr = qr;
    state.msgs.push('__RAW__');
  });

  state.msgs.push(url);
  state.msgs.push("");
  state.msgs.push("Download the Authy App at https://www.authy.com/app/");

  FNS.reCompute(ws, state);

  return PromiseA.resolve();
};
github bunqCommunity / bunq-cli / src / Utils.ts View on Github external
export const displayQr = (text, errorLevel = "L") => {
    qrcode.setErrorLevel(errorLevel);
    console.log("");
    qrcode.generate(text);
};
github Azure-Samples / SpeechToText-WebSockets-Javascript / samples / browser / sample-server.js View on Github external
function printServerInfo(url) {
    console.log('Up and running @ ' + url);
    qrcode.setErrorLevel('H');
    qrcode.generate(url, {small: true});
}

qrcode-terminal

QRCodes, in the terminal

Apache-2.0
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis