狠狠撸

狠狠撸Share a Scribd company logo
QR Code
Brought to you by Boshan Sun
1
Why QR code? 2
Why QR code? 3
Why QR code? 4
Why QR code? 5
How QR code works?
.
"show me the money"
↓
+---+------------+---+
| | ## ## | |
+---+ # # # +---+
| # # # # |
| # # ## # |
| # # # # # # |
+---+ # ## # |
| | # # # # |
+--------------------+
↓
"show me the money"
6
Data structure
.
{{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0},
{0,0,0,0,0}}
7
QR code structure 8
Structure: nder patterns 9
Structure: seperators 10
Structure: alignment patterns 11
Structure: timing patterns 12
Structure: dark module 13
Structure: reserved format areas 14
Structure: reserved version areas 15
Structure: data & ecc 16
Structure: quite zone 17
Encoding mode
numeric 12345 9527
alphanumeric "hello world 123"
kanji "自動車車車"
byte "doughnut doughnut doughnut giraffe" "你好, 世界!”
18
Byte mode encoding
mode indicator 0100
count indicator 0001 0001
encoded data 0111 0011 ...
terminator 0000
padding byte 1110 1100 0001 0001
show me the money
0100 0001 0001 0111 0011 0110 1000 0110 1111 0111
0111 0010 0000 0110 1101 0110 0101 0010 0000 0111
0100 0110 1000 0110 0101 0010 0000 0110 1101 0110
1111 0110 1110 0110 0101 0111 1001 0000
19
Error correction coding
? Reed-Solomon
? Galois Field GF(256)
? Polynomial long division
20
Reed-Solomon 21
Galois Field 22
Polynomial long division
.
message polynomial
rs_ecc = --------------------
generator polynomial
0100 0001 0001 0111 0011 0110 1000 0110 1111 0111
0111 0010 0000 0110 1101 0110 0101 0010 0000 0111
0100 0110 1000 0110 0101 0010 0000 0110 1101 0110
1111 0110 1110 0110 0101 0111 1001 0000
65,24,54,134,247,114,6,214,82,7,70,134,82,6,214,246,230,87,144
--------------------------------------------------------------
0,87,229,146,149,238,102,21
87,3,122,77,183,109,202
0101 0111 0000 0011 0111 1010 0100 1101 1011 0111 0110 1101
1100 1010
23
Data + ecc
.
0100 0001 0001 0111 0011 0110 1000 0110 1111 0111
0111 0010 0000 0110 1101 0110 0101 0010 0000 0111
0100 0110 1000 0110 0101 0010 0000 0110 1101 0110
1111 0110 1110 0110 0101 0111 1001 0000 0101 0111
0000 0011 0111 1010 0100 1101 1011 0111 0110 1101
1100 1010
24
Matrix so far 25
Fill in the data 26
Data masking 27
Mask 0 28
Mask 1 29
Mask 2 30
Mask 3 31
Mask 4 32
Mask 5 33
Mask 6 34
Mask 7 35
Apply masks 36
Apply masks 37
Penalty rules 38
Rule 1 39
Rule 2 40
Rule 3 41
Rule 4 42
And the winnder is… 43
Mask 3 44
Format information 45
Format information 46
Format information 47
Almost done 48
Finished 49
Customize QR code 50
Customize QR code 51
Customize QR code 52
Customize QR code 53
Padding with 0 54
XOR the mask 55
XOR the mask 56
Draw the pattern bits 57
Some work 58
Some work 59
60

More Related Content

QRCodes are Fun, Easy, and Useful for Links, Payments and Identity Verification