Explain to me how QR codes work

585 viewsOtherTechnology

I understand the code itself is a different make up of black/white grids to get your phone to recognize a linked site. But at some point won’t we completely run out of possible image combinations making them obsolete or is it something that regenerates a new site to QR connection? (On mushrooms so I might not have asked this very well lmao)

Basically will we run out of QR codes and if not how is there an endless supply?

In: Technology

10 Answers

Anonymous 0 Comments

QR code is simply a “pixelised” version of a string of characters.

Basically you start with the string you want to put: HTTP://REDDIT.COM then convert that into binary. To do so, you use the [ASCII table](https://www.asciitable.com/). This is a standard dating from the early computers that map each characters to a number. The result would be: 01001000 01010100 01010100 01010000 00111010 00101111 00101111 01010010 01000101 01000100 01000100 01001001 01010100 00101110 01000011 01001111 01001101.

You then add some more zero to fill up the space for the desired QR code size. You can’t have unused space, so you fill it up.

Then you take that, and encapsulate it into the QR stuff, which add some more informations and length and also some error detection and recovery data. The error recovery and detection stuff add more bits that allow to detect and fix some of the errors. It do so by adding some redundant data and some cleaver stuff.

Now, you pass those 1 and 0 into some encoding scheme. Basically what it do is prevent too many of the same value to be in a row, for example (not sure of the exact encoding), it can say that if there is more than 3 of the same values in a row then you invert the next bit. So if you have 1111000 you get like 11100010. This prevent a long space that is all black or all white and help to figure out the bits.

And finally you generate the white and black dots, with the QR decoration stuff in the corners and center. The decorations in the corners are to identify the orientation of the QR code, so it read it the right way. Also, the decoration in the center actually destroy some of the data in the QR code, but that data is recovered via the error detection and recovery mechanism. It therefore reduce the reliability of the QR code, but since it work many do use it. It just mean that damage to some other places in the code will probably make it fail to decode, while it may have been able to be recovered if that center part was not there, as it would have more recovery data present.

So will you run out of QR code? No, because the code contain the information itself and is generated based on that, and is not an ID of some sort. And this is also why there is different QR code size, some contain little information, so can be small, others is huge because it contain alot of informations.

You are viewing 1 out of 10 answers, click here to view all answers.