因为春运,热心的网友wangbigbird发表了有名的北京地区2009年春运火车票购买指南
文中详细的介绍了火车票真假识别的一些办法,前几天在水木上发现一篇文章 北京假票一张,大家注意!
ICollection 从条形码的角度说明了这是一张假票:
发信人: ICollection (集合), 信区: TrafficInfo 标 题: Re: 北京假票一张,大家注意! 发信站: 水木社区 (Sun Jan 18 13:48:37 2009), 站内 这票明显是票骗子自己PS画出来的, 条码下面的数字中票号后面,里程前面的那34位数字多了1位。 而且这段条码与数字也不相符,第一个竖线就错了,应该是粗线的。
按照条码算法,这段条码应该是这样的,那张假票完全是瞎画。 【 在 ICollection (集合) 的大作中提到: 】 : 这票明显是票骗子自己PS画出来的, : 条码下面的数字中票号后面,里程前面的那34位数字多了1位。 : 而且这段条码与数字也不相符,第一个竖线就错了,应该是粗线的。 : ...................
发信人: ICollection (集合), 信区: TrafficInfo 标 题: Re: 北京假票一张,大家注意! 发信站: 水木社区 (Sun Jan 18 14:01:48 2009), 站内 START_B 1位字母 CODE_C 6位数字 34位数字 4位数字 STOP 【 在 dudux (dudux) 的大作中提到: 】 : 什么叫128B+128C? : 是说有字母的那段用128B其它用128C吗?
刚好,一直想了解一下条形码的知识就查阅了一些资料。各种条形码分类就不说了。
火车票的CODE128条形码规范,网上已经有了很好的文档:All About Code 128 Barcode
简单的说Code 128的条形码的组成为:
QUIET ZONE + START + DATA + CHECK CHAR + STOP + QUIET ZONE
Code 128 条形码的每一个数据字符由 11个黑白单位(modules)构成(STOP比较特殊由13个单位构成),3个条和3个间隔组成这11个单位,每个条或间隔的宽度为1-4。
Code 128 有 A B C 三组代码集,A-编码包含标准键盘字母、数字及控制符和特殊符号;B-编码包含所有标准键盘字母、数字及小写字母和控制符;C-编码0-99的数字和控制符。
一组条形码可通过CODE 和 SHIFT指定后续条形码的代码集。
火车票的R079252字符(前14位数字没在条形码中表示)如下所示:
<!-- [if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><!-- [if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning/> <w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing> <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery> <w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:SpaceForUL/> <w:BalanceSingleByteDoubleByteWidth/> <w:DoNotLeaveBackslashAlone/> <w:ULTrailSpace/> <w:DoNotExpandShiftReturn/> <w:AdjustLineHeightInTable/> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:UseFELayout/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!-- [if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--> <!-- [if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!-- [if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1051"/> </xml><![endif]--><!-- [if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--><!-- [if gte vml 1]><v:group id="_x0000_s1042" style="position:absolute; left:0;text-align:left;margin-left:109.75pt;margin-top:106.8pt;width:251.75pt; height:24.9pt;z-index:1" mce_style="position:absolute; left:0;text-align:left;margin-left:109.75pt;margin-top:106.8pt;width:251.75pt; height:24.9pt;z-index:1" coordorigin="2345,2361" coordsize="5035,498"> <v:line id="_x0000_s1043" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="2345,2361" to="2345,2844" coordsize="21600,21600"/> <v:line id="_x0000_s1044" style="position:absolute;mso-position-horizontal:absolute; mso-position-vertical:absolute" mce_style="position:absolute;mso-position-horizontal:absolute; mso-position-vertical:absolute" from="2349,2361" to="7380,2361" coordsize="21600,21600"/> <v:line id="_x0000_s1045" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="3170,2367" to="3170,2850" coordsize="21600,21600"/> <v:line id="_x0000_s1046" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="3920,2361" to="3920,2844" coordsize="21600,21600"/> <v:line id="_x0000_s1047" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="4730,2376" to="4730,2859" coordsize="21600,21600"/> <v:line id="_x0000_s1048" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="5510,2376" to="5510,2859" coordsize="21600,21600"/> <v:line id="_x0000_s1049" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="6315,2367" to="6315,2850" coordsize="21600,21600"/> <v:line id="_x0000_s1050" style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" mce_style="position:absolute;flip:y; mso-position-horizontal:absolute;mso-position-vertical:absolute" from="7095,2367" to="7095,2850" coordsize="21600,21600"/> </v:group><![endif]--><!-- [if !vml]--> <!-- [endif]-->
<!-- [if gte vml 1]><v:line id="_x0000_s1029" style="position:absolute; left:0;text-align:left;flip:y;z-index:4;mso-position-horizontal:absolute; mso-position-vertical:absolute" mce_style="position:absolute; left:0;text-align:left;flip:y;z-index:4;mso-position-horizontal:absolute; mso-position-vertical:absolute" from="68.5pt,-.45pt" to="68.5pt,23.7pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--><!-- [endif]--><!-- [if gte vml 1]><v:line id="_x0000_s1034" style='position:absolute;left:0;text-align:left;flip:y; z-index:9;mso-position-horizontal:absolute;mso-position-vertical:absolute' from="264.75pt,-.45pt" to="264.75pt,23.7pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--> <!-- [endif]--><!-- [if gte vml 1]><v:line id="_x0000_s1033" style='position:absolute;left:0;text-align:left;flip:y; z-index:8;mso-position-horizontal:absolute;mso-position-vertical:absolute' from="225.75pt,-.45pt" to="225.75pt,23.7pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--> <!-- [endif]--><!-- [if gte vml 1]><v:line id="_x0000_s1032" style='position:absolute;left:0;text-align:left;flip:y; z-index:7;mso-position-horizontal:absolute;mso-position-vertical:absolute' from="185.5pt,0" to="185.5pt,24.15pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--> <!-- [endif]--><!-- [if gte vml 1]><v:line id="_x0000_s1031" style='position:absolute;left:0;text-align:left;flip:y; z-index:6;mso-position-horizontal:absolute;mso-position-vertical:absolute' from="146.5pt,0" to="146.5pt,24.15pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--> <!-- [if gte vml 1]><v:line id="_x0000_s1028" style='position:absolute;left:0;text-align:left;flip:y; z-index:3;mso-position-horizontal:absolute;mso-position-vertical:absolute' from="27pt,0" to="27pt,9.8pt" coordsize="21600,21600"/><![endif]--><!-- [if !vml]--> <!-- [if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" style="width:414.75pt; height:189.75pt" mce_style="width:414.75pt; height:189.75pt"> <v:imagedata src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image007.jpg" mce_src="file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_image007.jpg" o:title="part"/> </v:shape><![endif]--><!-- [if !vml]--><!-- [endif]-->
序号 |
符号 |
Pattern B S B S B S |
1 |
START (Code B) |
2 1 1 2 1 4 |
2 |
R |
2 3 1 1 3 1 |
3 |
CODE C |
1 1 3 1 4 1 |
4 |
07 |
1 2 2 3 1 2 |
5 |
92 |
1 1 1 1 4 3 |
6 |
52 |
2 1 3 3 1 1 |