There are some features we use almost every day but do not know anything about the feature. One such feature is QR codes. We use it almost every day as we travel, eat, shop and so on. A few years ago, no one will believe that a small black-and-white code will have so many uses. Who could have believed that this seemingly ordinary black-and-white square is subtly changing our lives? Users can scan QR codes to perform a range of functions. You can use this code to add friends to your social circle. Users can also use it to complete a payment or even use it to join a group. These are just the most common application scenarios of QR codes. However, what do you know about this code? Why does the code have small squares? Let’s take a look at some details of the QR codes.
Composition and principle of QR codes
QR means Quick Response. These codes first appeared in 1994. However, it took another 7 years (2001) before it was popularized in China. These codes are transformed from barcodes. It is the most common on commodity packaging. It consists of black and white vertical stripes with different thicknesses. The information about the commodity is hidden in this barcode.
A barcode carries information in one dimension. However, when it is a two-dimensional code (horizontal and vertical dimensions), it changes from a bar into a square shape. Whether it is a barcode or a QR code, it is essentially an information portal. A complete QR code is composed of several small black squares and small white squares. First, characters such as numbers, letters, and symbols are converted into binary “0” and “1” through certain operations and encoding rules. Then, the code is completed using a series of optimization algorithms. The small white squares represent binary “0”, and the small black squares represent “1”.
When reading the two-dimensional code, the 01 sequence on the two-dimensional code is read through the colour contrast. Then, the binary is converted into the characters we can recognize through numbers. The arrangement of the binary coding is the embodiment of information. Its basic functional areas are divided into
1. Position detection graphic
There is a large black and white square in the three corners of the QR code – the position detection graphic. This together with the position detection graphic separator and positioning graphic helps the two-dimensional code to be positioned during the formation process to reduce the occurrence of the wrong arrangement. Whether your phone is scanning horizontally, vertically, or diagonally, it recognizes the code. For each QR code, their position is fixed, but the size specification will vary.
2. Format information
This indicates the error correction level of the code. The higher the level, the stronger the error correction capability. For example, if there are 100 codeword data to be encoded, and half of them, ie, 50 codewords, are to be error-corrected, the calculation method is as follows. Error correction requires twice as many symbols as codewords (RS encoding*), so in this case, the number is 50 × 2 = 100 codewords. Therefore, the total number of code words is 200, of which 50 code words are used for error correction. Thus, the error correction rate relative to all code words is 25%.
Gizchina News of the week
This ratio is equivalent to the “Q” level in the QR code error correction level.
- Level L: Up to 7% of characters can be corrected
- Level M: Up to 15% of characters can be corrected
- Level Q: Up to 25% of characters can be corrected
- Level H: Up to 30% of characters can be corrected
3. Correction graphics
When the image is bad to a certain extent, the decoding software can use it to synchronize the coordinate mapping of the image module. The number and position of the QR code correction graphics of different specifications are different. Once the specification is determined, its quantity and location are also determined.
4. Data and error correction codewords
The code also stores information and error correction codewords. This is a fault-tolerant mechanism for QR codes. For example, if less than 30% of the code goes, the code remains accurate. The scanner can still accurately obtain information from the incomplete code.
5. Version information
The code symbol has a matrix of 40 specifications, ranging from 21 x 21 (version 1) to 177 x 177 (version 40). Each version has 4 more modules in the vertical and horizontal directions than the previous version. The maximum number of input characters and amount of data, character type and error correction level is equal for each code. If the data increases, it will require more symbols and the code will be larger. As the code scan starts, it recognizes the areas with the information immediately. It follows the detection pattern, position detection pattern separator, and positioning pattern.
Will the code get exhausted?
Now, almost every country on the planet uses QR codes every day. The number of daily use exceeds 10 billion. Will the design language of these codes ever finish? Well, this depends on how many codes humans can make. There are many types of QR codes (QR code is just one of them). We also have Code 49, Code 16K, etc. All these code types can carry a lot of information. Even for the same code, there are different versions all of which carry a lot of information. This is because the codes come with different encoding patterns.
Also, the same code can be reused. This also increases the timeline for these codes. The smallest QR code we are currently using is 21 × 21 in size. It has 21 points which can contain 1 or 0. Therefore, according to the method of permutation and combination, it is 2 to the 441st power. If we expand this, the number of derivable codes is 5.678×10^132. This is already an astronomical number. Only one version of a QR code with one encoding method can store so much information. Even if humans use up to 10 billion codes a day, we don’t have to worry about running out of codes.
Are these codes entirely safe?
While “Living on Code” brings us convenience, security issues also follow. QR code generators are easy to obtain from the Internet and have no restrictions on their distribution. Thus, it is quite easy for criminals to manipulate the codes. The following are some common pitfalls of QR codes, you should be more careful
- Scam – codes could be fake to steal your information
- Fishing QR code
- Get free prizes scam
How to strengthen the code
To ensure the security of QR codes, efforts need to be made in the following four aspects:
- When enterprises provide QR codes externally, they must ensure the security of QR codes.
- When we scan the QR code, firstly, we use the terminal with the function of security identification
- Do not scan the codes from unknown sources
- National legislation to protect code payments