Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The whole 666 embedded in barcodes thing is sort of interesting. The UPC symbology uses an unusual encoding method, not seen in other barcode families, where every digit has two different representations, a "left" and "right" version. These were originally used to allow readers to detect the direction that they were scanning the barcode (whether it was upside down or not). This avoided the need for distinct "start" and "end" markers, as most barcode symbologies have. Instead, UPC had a "guard" symbol used at the beginning and end and, following the symmetric design principle, in the middle as well. Later, GS.1/EAN was designed to add a digit while mostly maintaining compatibility with UPC readers. To do this, yet a third variant representation was added, so each digit has an L, R, and G representation. On the left side, L and G variants can be used to encode the check digit.

I am not sure exactly why UPC uses a center guard, but I think it was probably just to provide more material for clock recovery, which was more challenging when UPC was designed. Mechanically scanning laser readers did not necessarily have well-controlled scan speeds, and in the early days manually scanned readers were common, so more clock recovery was better.

It so happens that the guard symbol chosen, which is a trivial alternating pattern, has a fairly close resemblance to the R variant of the digit 6 (but not to the L or G variants). It's not really the same, as the guard pattern is 3 modules wide (except the center one which is 5 modules) while digits are all seven modules. We could describe it this way: the guard pattern is 101 (or 01010 in the center case) while the R variant of 6 is 1010000. The "101" part looks similar. The L variant of 6 is 0101111 (L and R variants are the inverse of each other) and does not superficially resemble the guard at all. For completeness, the G variant is 0000101, but it was not in use when the "666 in barcodes" conspiracy theory was most current.

UPC is kind of weirdly complicated, reflecting its age. Later symbologies mostly use much simpler designs, usually with a distinct "start" and "end" guard and no center guard at all, and only one representation of each digit. Direction is recovered by telling the start/end markers apart, and check digits are implemented with just a digit in the body, rather than the curious "character variant" method adopted by GS.1 for compatibility.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: