How to read QR code manually
Reading QR codes without a computer!
https://qr.blinry.org/
◆Basic elements of QR code
There are various sizes of QR codes, which can be expressed as 'versions'. The minimum version is 'Version 1' with 21 x 21 cells, and after that, each version increases by 4 cells in the vertical and horizontal directions.
The basic components of such a QR code are as follows.
・Finder pattern
Square pattern placed in three corners to help scanners identify QR codes.
·separator
A blank line around the finder pattern.
・Alignment pattern
A pattern that helps the scanner correctly read the QR code, and is used to correct cell misalignment caused by distortion. However, for version 1 QR codes, no alignment pattern exists.
・Timing pattern
Another pattern to help the scanner read the QR code correctly. White and black cells are arranged alternately.
・Format information
The format information part contains information about the mask pattern and error correction rate used by the QR code, and there are vertical and horizontal versions.
・Quiet zone
The white frame that surrounds the QR code is called the 'quiet zone' and is used to make it easier for the scanner to identify the start and end positions of the QR code.
In other words, in a QR code, data is represented by the uncolored parts below.
◆Mask pattern
The three cells surrounded by the orange line in the formatting information show a 'mask pattern'.
The black cell in the QR code represents '1' and the white cell represents '0', so in the case of the above QR code, the mask pattern is '110' (6 in decimal). Since the mask pattern is specified using three cells, white and black, the mask pattern types are basically '111' (decimal number: 7) '110' (decimal number: 6) '101' (decimal number: 5) There are 8 types: '100' (decimal number: 4) '011' (decimal number: 3) '010' (decimal number: 2) '001' (decimal number: 1) '000' (decimal number: 0).
Each mask pattern is as follows.
The mask pattern is used to overlap the original QR code, and cells where black and black overlap are converted to white, cells where black and white overlap are converted to black, and cells where white and white overlap are converted to white.
◆Encoding
Next, encode. To encode, check the four cells at the bottom right of the QR code.
Then apply a mask pattern that corresponds to the QR code. In the case of the above QR code, the mask pattern is '110', so the mask pattern to be applied is as follows.
When the original QR code (left) and the mask pattern (middle) are overlapped, cells where black and black overlap are converted to white, cells where black and white overlap are converted to black, and cells where white and white overlap are converted to white, encoded. A pattern (right) is revealed.
There are the following five types of encoding patterns, and in this case, it corresponds to a pattern called 'Byte'.
◆Cell reading rules
Data is read in the order in which the orange line zigzags from the bottom right corner. Since it does not represent data, you can skip finder patterns, separators, alignment patterns, timing patterns, format information, etc.
First, the first four cells are the part that indicates the encoding pattern (the orange border), so we will exclude them. Next, since the encoding pattern was 'Byte', if we consider that 1 cell = 1 bit (bit), we can see that 1 Byte = 8 bits, so it can be expressed as 1 Byte = 8 cells. In other words, 1 byte of information is summarized in the area surrounded by the blue frame.
White cells represent '0' and black cells represent '1', so if 1Byte of data is as follows, the data per 1Byte will be '00001100'. Then, by converting each byte of binary value into hexadecimal numbers or ASCII characters , it becomes possible to decipher the data hidden in the QR code.
Related Posts:
in Note, Posted by logu_ii