- CPC Binary Barcode
CPC Binary
Barcode isCanada Post 's proprietarysymbology used in its automated mail sortation operations. This barcode is used on regular-size pieces of mail, especially mail sent using Canada Post's [http://www.canadapost.ca/personal/offerings/lettermail_personal/can/default-e.asp Lettermail] service. This barcode is printed on the lower-right-hand corner of each faced envelope, using a uniqueultraviolet -fluorescent ink.ymbology description
The applied barcode uses printed and non-printed bars spaced 3 mm apart, and consists of two fields. The rightmost field, which is 27 bars in width, encodes the destination postal code. The leftmost field is 9 bars in width and applied right below the printed destination address. It is currently unclear what this field is used for.
In the postal code field, the rightmost bar is always printed, to allow the sortation equipment to properly lock onto the barcode and scan it. The leftmost bar, a parity field, is printed only when necessary to give the postal code field an odd number of printed bars. The remaining 25 bars represent the actual destination postal code. To eliminate any possibility of ambiguity during the scanning process, run-length restrictions are used within the postal code field. No more than five consecutive non-printed bars, or spaces, are permitted, and no more than six consecutive printed bars are allowed.
The actual representation of the postal code is split into four subfields of the barcode, each with their own separate encoding table. The first and last subfields, which share a common encoding table, are always eight bars in width, and encode the first two characters and the last two characters of the postal code respectively. The second subfield, which encodes the third character of the postal code, is always five bars in width, and the third subfield, which encodes the fourth character, is always four bars wide.
Generating barcodes
#Disregarding the space, divide the postal code into four subfields (e.g. K1-A-0-B1).
#Locate the contents of each subfield in the encoding tables below and record the hexadecimal numbers that they correspond to. (e.g. K1-A-0-B1 becomes 32-07-A-C2.)
#Convert those hex numbers to binary, and add leading zeroes where required.
#Change the binary numbers into bars. "Zero" bits in the resulting binary numbers correspond to spaces in the barcode, while "one" bits correspond to printed bars, with the least significant bit of each number corresponding to the rightmost bar in each subfield of the barcode.
#Add an "alignment" bar onto the end of the resulting barcode.
#Count up the number of bars you have. If you get an even number, add another bar onto the start of the barcode.Here are some examples of encoded postal codes. The colour used in these examples is meant to simulate the actual colour of the ink used to print the barcodes, however it does not exactly match. Select these examples to make them more visible.
A1B 2C3: | ||| | || | || || |||
K1A 0B1: | || | |||| | || | |
V6B 2R5: | | || || | | | | | ||Encoding tables
Unused codepoints are indicated with asterisks.{| cellspacing=0 width=100% style="text-align: center; font-family: monospace;"
colspan=8 style="font-size: 125%; border: 1px solid blue;" | Second field (5 bits)
colspan=4 style="font-size: 125%; border: 1px solid #00C000;" | Third field (4 bits)
-
width=8% style="border: 1px solid #808080; line-height: 100%;"| 00: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 01: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 02: L
width=8% style="border: 1px solid #808080; line-height: 100%;"| 03: K
width=8% style="border: 1px solid #808080; line-height: 100%;"| 04: M
width=8% style="border: 1px solid #808080; line-height: 100%;"| 05: R
width=8% style="border: 1px solid #808080; line-height: 100%;"| 06: J
width=8% style="border: 1px solid #808080; line-height: 100%;"| 07: A
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 2: 1
width=8% style="border: 1px solid #808080; line-height: 100%;"| 3: 3
-
width=8% style="border: 1px solid #808080; line-height: 100%;"| 08: H
width=8% style="border: 1px solid #808080; line-height: 100%;"| 09: G
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0A: S
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0B: C
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0C: B
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0D: E
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0E: Y
width=8% style="border: 1px solid #808080; line-height: 100%;"| 0F: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 4: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 5: 5
width=8% style="border: 1px solid #808080; line-height: 100%;"| 6: 6
width=8% style="border: 1px solid #808080; line-height: 100%;"| 7: 7
-
width=8% style="border: 1px solid #808080; line-height: 100%;"| 10: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 11: V
width=8% style="border: 1px solid #808080; line-height: 100%;"| 12: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 13: X
width=8% style="border: 1px solid #808080; line-height: 100%;"| 14: T
width=8% style="border: 1px solid #808080; line-height: 100%;"| 15: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 16: N
width=8% style="border: 1px solid #808080; line-height: 100%;"| 17: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 8: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 9: 2
width=8% style="border: 1px solid #808080; line-height: 100%;"| A: 0
width=8% style="border: 1px solid #808080; line-height: 100%;"| B: 4
-
width=8% style="border: 1px solid #808080; line-height: 100%;"| 18: W
width=8% style="border: 1px solid #808080; line-height: 100%;"| 19: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1A: Z
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1B: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1C: P
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1D: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1E: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| 1F: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| C: *
width=8% style="border: 1px solid #808080; line-height: 100%;"| D: 8
width=8% style="border: 1px solid #808080; line-height: 100%;"| E: 9
width=8% style="border: 1px solid #808080; line-height: 100%;"| F: *
Wikimedia Foundation. 2010.