Barcodes consist of a series of bars, some fat (ones), some thin (zeros), that make numbers that can be easily scanned. Barcodes include identifiers at the beginning, middle, and end (usually 6, 6, and 6), which make sure a bar codes gets scanned the right direction, and that the scan was complete.

You might also want to look at The hidden evil in UPC bar codes.