Search code examples
qr-codebarcodebarcode-scanner

QR Code - is uniqueness guaranteed for unique inputs


I want to generate QR codes to pass a unique alpha-numeric code to a site. The QR will be generated from a string like:

https://example.com/ABCD1234

The ABCD1234 is the unique code and there will be ~100 million of them. Can I be sure no two QR codes will be the same, and be read to 100% accuracy?

Anything to watch out for standards wise?


Solution

  • 100% is too pure of a number to get specific advice. This reply is general, and not meant for any super mission critial needs.

    The clarity of barcodes in general depends on the quality of the printed image, as well as the reader's ability to decode (optics and decoder). QR codes have some error correction attributes (https://en.wikipedia.org/wiki/QR_code). Commercial decoders, even for webcams, are used widely for consumer and retail applications.

    Keep in mind, barcodes were designed for reading labels quickly, and often while moving. They are not well suited for things like security codes, where deep levels of checks are needed. It is possible for things to go wrong.

    Given that, it really depends on what you mean by 100%. The barcode symbology cannot make many guarantees, but the content might begin to. If your line-of-business app is mildly mission critical, and your app can control what's printed on labels, and the http address is to 'your' line-of-business web site, you could append a check value within the content, in the QR code printed. For example, ~https://example.com/ABC1234?check=5551212, has a check value which the web site can optionally verify. However, the more content you have, the more dense the printed pattern will get (and possibly more difficult to read).