1

The manual for the qrcode package contains a section entitled "Limitations and Cautions," which warns:

• The QR specification includes modes for encoding numeric, alphanumeric, or Kanji data more efficiently. This package does not (yet) offer those options.

• The QR specification offers ways to string lengthy data across multiple QR codes. This package does not implement that possibility.

I have only a beginner's understanding of how to work with QR codes, so I don't actually know what this means in practical terms. What do those limitations mean in terms of things I might want to do with QR codes, but can't do?

crmdgn
  • 2,628

1 Answers1

3

Both of these limitations are related to storage capacity of a QR code. A QR code is often used to encode (website) urls, however they can be used to store arbitrary data like a number, a string, a sequence of Japanse Kanji characters (the QR code is invented in Japan), or just a byte sequence. The official standard defines different modes for each data type, that specify the number of bits for each character. These modes allow a simple data type such as a number or a Latin script alphanumeric string to be longer while it is still possible to encode more complex data using the other modes.

In the qrcode package only the binary (byte sequence) mode is implemented. Therefore it is not possible to express very long numbers or strings within a single QR code, while this would be possible if the full standard with all the modes was implemented. Of course it is still possible to encode numbers or strings or Kanji using the binary mode, but the maximum size is a bit smaller.

As an example: for a QR code of level 5 (37x37 pixels) with medium level error correction (which is the default for the qrcode package) using modes you can store numbers of length 202, strings of length 122 and byte sequences of length 84. Using the qrcode package this means that the maximum length of numbers and strings will also be 84 instead of 202/122.

Considering the second limitation: if you want to encode input that does not fit in a single QR code, then the official standard allows to split the input over multiple QR codes, which should be scanned one after the other and then combined by the reader to restore the original input. However, the qrcode package does not implement this feature. This means that if you have long input that you want to encode then you cannot use the package (or split the input yourself before creating QR codes and combining it afterwards).

Regarding the pixel size of the QR code (i.e., the version): the package chooses automatically the smallest size that can encode the data, up to level 40 (177x177 pixels). Also the error correction is automatically adjusted: if the minimum size at the required error correction level allows for encoding in a higher error correction level then the package will automatically select the higher error correction level.

Sources: the qrcode manual, Wikipedia (https://en.wikipedia.org/wiki/QR_code#Storage) and a full table of QR code capacity by mode, version and error correction level at https://blog.qr4.nl/page/QR-Code-Data-Capacity.aspx.

Marijn
  • 37,699