QR codes Limits

2019-04-20 14:20发布

I have to generate codes with custom fields: id of field+name of field+values of the field.

  1. How long is the data I can encode inside the QRcode? I need to know how many fields\values I can insert.

  2. Should I use XML or JSON or CSV? What is most generic and efficient?

2条回答
Juvenile、少年°
2楼-- · 2019-04-20 14:52

The maximum number of alphanumeric characters you can have is 4,296. Although this will require the lowest form of error correction and will be very hard to scan.

JSON is generally more efficient at data storage than XML.

However, you will need to write your own app to scan the code - I don't know of any which will process raw JSON or XML. All the scanners will show you the text, though.

查看更多
smile是对你的礼貌
3楼-- · 2019-04-20 14:54

XML / JSON will not qualify for a QR code's alphanumeric mode since it will include lower-case letters. You'll have to use byte mode. The max is 2,953 characters. But, the practical limit is far less -- perhaps a few hundred characters.

It is far better to encode a hyperlink to data if you can.

As Terence says, no reader will do anything with XML/JSON except show it. You need a custom reader anyway to do something useful with that data. (Which suggests this is not a good use case for QR codes.) But if you're making your own reader, you can use gzip compression to make the payload much smaller. Your reader would know to unzip it.

You might get away with something workable but this is not a good approach in general.

查看更多
登录 后发表回答