进击的二维码

JeanChen

2019/01/31 发布于 技术 分类

二维码源于日本,如今世界各国都在使用。一张简单的二维码蕴藏了不简单的信息。二维码究竟是如何画出来的?二维码安全吗?为何在二维码中加个图标还能被扫出来?卫星通讯中用到的Reed- Solomon 纠错码如何被用在了二维码中?本期讲座为您揭晓二维码的生成原理,听完保证可以get手绘二维码技能。

ArcBlock  区块基石  技术培训 

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