Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Numeric and Alphanumeric encoding modes #13

Open
glumb opened this issue Aug 16, 2020 · 2 comments
Open

Support Numeric and Alphanumeric encoding modes #13

glumb opened this issue Aug 16, 2020 · 2 comments

Comments

@glumb
Copy link

glumb commented Aug 16, 2020

QR codes can also be encoded with numeric or alphanumeric encoding for optimal data density. Quoting https://en.wikipedia.org/wiki/QR_code

Input mode Bits/char. Possible characters, default encoding
Numeric only 3⅓ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Alphanumeric 0–9, A–Z (upper-case only), space, $, %, *, +, -, ., /, :
Binary/byte 8 ISO 8859-1
Kanji/kana 13 Shift JIS X 0208

Is this done automatically in this library? How can I configure what encoding should be used?

@ghost
Copy link

ghost commented Nov 27, 2020

Based on a quick test, it looks like alphanumeric encoding is not automatic.

@ghost
Copy link

ghost commented Nov 27, 2020

This library worked well for me: https://github.com/soldair/node-qrcode

const QRCode = require('qrcode')
QRCode.toString(
  'TEXT',
  { type: 'svg', errorCorrectionLevel: 'M', margin: 0 },
  function (error, string) {
    if (error) console.error(error)
    console.log(string)
  }
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant