条码规范——Code 93
来源:互联网 发布:写频软件 编辑:程序博客网 时间:2024/06/07 20:55
CODE 93 BACKGROUND INFORMATION
Code 93 was designed to complement and improve upon Code 39. Code 93 is similar in that it, like Code 39, can represent the full ASCII character set by using combinations of 2 characters. It differs in that Code 93 is a continuous symbology and produces denser code. It also encodes 47 characters compared to Code 39's 43 characters.A typical Code 93 bar code is:
Code 93 is a continous, variable-length symbology.
COMPUTING THE CHECKSUM DIGIT
Code 93 always includes two check characters which are referred to as "C" and "K". These two check characters immediately follow the encoded message itself and immediately precede the final stop character.The "C" checksum character is the modulo 47 remainder of the sum of the weighted value of the data characters. The weighting value starts at "1" for the right-most data character, 2 for the second to last, 3 for the third-to-last, and so on up to 20. After 20, the sequence wraps around back to 1. In the above example (TEST93), the "C" checksum would be calculated as follows:
- DATATEST93VALUE2914282993WEIGHT654321WEIGHTED SUM1747011287183
Thus the sum of the individual weighted sums is 174 + 70 + 112 + 87 + 18 + 3 = 464. Modulo 47 gives a value of 9 with remainder 41. The value 41 is associated with the plus (+) sign, so the "C" check character would be encoded using the plus symbol encodation from the table below.
The "K" checksum character is calculated in basically the same way except that the weighting goes from 1 to 15. Also, the right-most character is now the "C" checksum character which was calculated in the step above.
- DATATEST93+VALUE291428299341WEIGHT7654321WEIGHTED SUM2038414011627641
Thus the sum of the individual weighted sums is 203 + 84 + 140 + 116 + 27 + 6 + 41 = 617. Modulo 47 gives us a value of 13 with a remainder of 6. The value 6 is associated with the ASCII character "6", so the "K" check character would be encoded using the "6" symbol encodation from the table below.
ENCODING THE SYMBOL
Once the checksum digit has been calculated we know the entire message which must be encoded in the bars and spaces. Continuing with our example, we will encode, from zero, the Code 93 bar code we used in our example above: HI345678with a checksum digit of 67.In the following text, we will discuss the encoding of the bar code by considering that the number "1" represents a "dark" or "bar" section of the bar code whereas a "0" represents a "light" or "space" section of the bar code. Thus the numbers 1101 represents a double-wide bar (11), followed by a single-wide space (0), followed by a single-wide bar (1). This would be printed in the bar code as:
STRUCTURE OF A CODE 93 BARCODE
A Code 93 bar code has the following structure:- A start character , represented below by the asterisk (*) character.
- Any number of characters encoded from the table below.
- The "C" and "K" checksum digits calculated as described above and encoded using the table below.
- A stop character, which is a second asterisk character.
CODE 93 ENCODING TABLE
Note that the characters ($), (%), (/), and (+) are special characters that are used to encode all 128 ASCII characters using Code 93's Full ASCII mode.
In Code 39, four of the characters ($, %, /, and +) are used to optionally encode all 128 characters-but there is no way to know whether those characters are being used as shift characters in Full ASCII mode or whether they are being used to represent $, %, /, and +. In Code 93 this problem is solved by reserving these four special characters exclusively to "shift" into Full ASCII mode.
CODE 93 ENCODING EXAMPLE
We will now code the example we used above, TEST93, plus the two checksum digits we calculated above.- The START character (*): 101011110.
- The digit "T": enocded as 110100110.
- The digit "E": enocded as 110010010.
- The digit "S": enocded as 110101100.
- The digit "T": enocded as 110100110.
- The digit "9": enocded as 100001010.
- The digit "3": enocded as 101000010.
- The "C" check digit "+": enocded as 101110110.
- The "K" check digit "6": enocded as 100100010.
- The STOP character (*): 101011110.
- Termination Bar: 1.
- NOTE: In the above encoding example note that the last component, the termination bar (#11), follows the last character. This is because all characters, including the STOP character, end with a space-the final termination character is used to "terminate" the last character so that the width of the final space can be determined.
EXTENDED CODE 93 ENCODING TABLE
It is possible, using Code 93's "Full ASCII Mode" to encode all 128 ASCII characters. This is accomplished by using the ($), (/), (%), and (+) symbols as "shift" characters. Those characters combined with the single character that follows indicate which Full ASCII character is to be used.The Extended Code 93 Encoding Table is identical to the Extended Code 39 Encoding Table except that Code 93 uses its four specialized shift characters ($), (/), (%), and (+) to shift to Full ASCII mode instead of Code 39 which isues the $, /, %, and + characters.
For example, to encode a lowercase B in Code 39, the sequence "+B" is used. In Code 93 the sequence would be encoded as "(+)B" where (+) refers to one of the four special characters that Code 93 can encode that Code 39 can't.
Use the Extended Code 39 Encoding Table for Extended Code 93 encoding, and just remember to use the special characters ($), (/), (%), and (+) whenever the Code 39 Encoding table refers to $, /, %, and +.
- 条码规范——Code 93
- 条码规范——Code 39
- 条码规范——Code 128
- 条码规范——EAN13
- 二维条码 QR Code
- CODE 39 条码生成
- HTML5+规范:barcode(条码扫描)
- HTML5+规范:barcode(条码扫描)
- CODE 128 条码生成方法
- 条码技术(CODE 39编码)
- QR code(Quick Response Code)二维条码
- CODE 128 条码打印类 实现条码打印、显示
- 二维条码 QR code 的解码
- 写code的规范
- java Code规范
- Python Code规范PEP8
- 条码
- 条码扫描二维码扫描——ZXing android 源码简化
- 设计模式-观察者模式
- 【怎样写代码】函数式编程 -- Lambda表达式(二):C#常用委托
- top命令详解
- Android 7.1 源码编译
- PriorityQueue 优先级队列【java】
- 条码规范——Code 93
- 延迟队列 DelayQueue 【JAVA】
- 条码规范——Code 128
- BZOJ 3884: 上帝与集合的正确用法 欧拉函数
- 13. Roman to Integer
- Springboot 之 自定义配置文件及读取配置文件
- DEM、TIN与栅格之间的关系
- 树莓派系统安装和调试
- 变形课 hdu1181 (深搜题)