Click here to Skip to main content
Click here to Skip to main content

USPS OneCode Barcodes

By , 3 Oct 2008
 

Introduction

This is not a typical article. The focus is on Intelligent Mail Barcode (4 State Customer Barcode) or USPS OneCode implementation as a direct solution for anyone who needs it. The downloads include one VB.NET and one C# class – VS2008 with .NET 3.5 syntax - that generate the string expression of OneCode barcodes and decode a barcode string. The code (uncommented) is a modified fraction of the Pathenon project (covers all known 1D and 2D barcodes) that you will read here on The Code Project in the near future, hopefully. I've noticed that there is no related article, so there you are with an ASAP solution for this new USPS symbology.

Basic Information

Intelligent Mail Barcode, also known as the USPS OneCode Solution or USPS 4-State Customer Barcode (abbreviated 4CB, 4-CB, or USPS4CB), is the latest barcode symbology of the United States Postal Services. It combines routing ZIP code information and tracking information into a single 4-state code. It effectively encodes data from POSTNET and PLANET barcodes into a single barcode while providing a greater range of tracking data.

A 4-state barcode is based on a tracker with ascenders and descenders. The four possible states are tracker (neither ascender nor descender), full (both ascender and descender), ascender only, and descender only. The Intelligent Mail barcode consists of 65 bars as a result of encoding data fields of the following types:

Tracking Code

  • Barcode Identifier as 2 digits (2nd digit must be 0–4)
  • Service Type Identifier as 3 digits
  • Mailer Identifier as 6 or 9 digits and
  • Serial Number as 9 (when used with 6 digit Mailer ID) or 6 (when used with 9 digit Mailer ID) digits

Routing Code

  • Delivery Point ZIP Code as 0, 5, 9, or 11 digits

The above fields, with a maximum of 31 digits in length, are encoded via a complex process (involving big integers and transposed lookups) to bars expressed as a string with 65 characters in the range of A, D, T, F. More information and specifications can be found here.

Conclusion

Note once again that this is not a typical article, but a direct solution for people dealing with this complex barcode symbology.

Thanks for your time.

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0

About the Author

drdigit

United Kingdom United Kingdom
Passionate "hands on" solution oriented developer, coding since 1983 with proficiency in VB (from v1 to .NET 2010), C#, MS SQL (from v6.0a to 2008 R2), mySQL (from v4 to v6), XML/XSL/XSD, (D)HTML, JavaScript, ... and fluency in PHP, working as a freelancer in GR, IE and UK.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionbarcodingmemberBarcoding House22-Jan-13 16:11 
Questiontransportation barcodemembersteve7g15-Feb-12 22:32 
AnswerRe: transportation barcodemembersybil_9-Oct-12 16:53 
Question.NET Barcode for ASP.NETmembersteve7g15-Feb-12 22:16 
QuestionOneCode Barcode Generator for .NETmemberKeepDynamic9-Jan-12 4:07 
GeneralMy vote of 4memberncik92-Aug-11 0:52 
GeneralDecoder in plan CmemberMember 420048219-Sep-10 15:22 
AnswerRe: Decoder in plan Cmemberdrdigit19-Sep-10 21:57 
GeneralBarcodememberJones xxx26-May-09 13:19 
Generalhelp pls....memberlakshmi priya.t.n29-Jan-09 17:41 
AnswerRe: help pls....memberdrdigit31-Jan-09 11:47 
GeneralCompilation errormemberrobertjb207-Jan-09 9:45 
AnswerRe: Compilation errormemberdrdigit8-Jan-09 5:14 
GeneralHere is another Implementation for .Net (C#) using USPS provided dll and fontsmemberMember 422991713-Nov-08 8:43 
QuestionSample applicationmemberamarbank23-Nov-10 6:38 
GeneralRe: Here is another Implementation for .Net (C#) using USPS provided dll and fontsmembercrobbins6-Jan-11 8:56 
GeneralRe: Here is another Implementation for .Net (C#) using USPS provided dll and fontsmemberSid Torres15-Jun-11 8:12 
QuestionRe: Here is another Implementation for .Net (C#) using USPS provided dll and fontsmemberbendece25-Feb-11 16:09 
QuestionIncorrect Decode Examplemembervoxdisc10-Nov-08 16:35 
AnswerRe: Incorrect Decode Examplememberbheiland22-May-09 2:15 
GeneralRe: Incorrect Decode ExamplememberGylfi Ingvason27-May-09 8:59 
GeneralRe: Incorrect Decode Examplememberbheiland27-May-09 13:59 
AnswerRe: Incorrect Decode Examplememberbheiland27-May-09 14:04 
GeneralRe: Incorrect Decode Examplememberbheiland27-May-09 14:23 
GeneralRe: Incorrect Decode ExamplememberGylfi Ingvason28-May-09 7:02 
GeneralRe: Incorrect Decode Examplememberbheiland28-May-09 11:28 
GeneralRe: Incorrect Decode ExamplememberGylfi Ingvason29-May-09 5:20 
GeneralRe: Incorrect Decode Example [modified]memberfwsouthern1-Nov-10 17:31 
GeneralRe: Incorrect Decode Examplememberbheiland14-Apr-11 3:31 
GeneralRe: Incorrect Decode Example [modified]memberfwsouthern14-Apr-11 3:46 
GeneralThank you for sharing your work...memberaccusteve4-Nov-08 8:08 
GeneralFailed Test CasesmemberMember 452829222-Sep-08 4:56 
AnswerRe: Failed Test Casesmemberdrdigit24-Sep-08 1:39 
QuestionPHP Version? :Dmembervoxdisc19-Aug-08 21:30 
GeneralGREAT!memberhpellegrino15-Aug-08 10:07 
GeneralCooool!membertharpa31-Oct-07 7:48 
QuestionOneCode string Decoder?memberres416-Oct-07 6:16 
AnswerRe: OneCode string Decoder?memberdrdigit16-Oct-07 22:53 
GeneralRe: OneCode string Decoder?membertharpa14-Mar-08 8:00 
NewsOneCode Decoder is finally herememberdrdigit16-Aug-08 14:36 
GeneralRe: OneCode Decoder is finally herememberbheiland29-May-09 2:45 
GeneralRe: OneCode Decoder is finally heremembercrobbins6-Jan-11 8:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130619.1 | Last Updated 3 Oct 2008
Article Copyright 2007 by drdigit
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid