undergroundmarketingconspiracy.comundergroundmarketingconspiracy.com

The barcode on the package: how stripes turn into a price

Cashiers used to type in the price of every item by hand, and checkout lines dragged on forever. The barcode was born out of a wish to speed that up: let a machine read the code off the package itself.

There's no magic in the stripes. It's just a row of dark and light lines of different widths. The scanner shines a red beam on them and measures how much light bounces back. A light bar reflects a lot, a dark one very little. From the pattern and width of those pulses, the device gets a sequence of digits.

An important detail: the barcode itself doesn't contain the price. It stores the product number, and the price lives in the store's database. That's why prices can change without reprinting the labels on the packaging.

The code also has a safeguard against errors. The last digit is a check digit, calculated from the others. If the scanner misreads something, the checksum won't add up and the device simply won't beep. That way a bit of dust or a scratch won't turn a carton of milk into a diamond.

Square codes like the ones apps show you work on the same idea, except they encode information in two directions instead of one and hold far more data.

The barcode on the package: how stripes turn into a price
← Все публикации