My Super Power

I once wrote an app. Crazy right?

The main requirement for this app was that it needed to scan ITF barcodes. I didn't know anything about barcodes at the time, but I knew iOS had built-in support for handling some barcodes. Turns out, it didn't have support for this particular style of barcode.

I started thinking about how one-dimensional barcode scanners work – shining a light and reading what bounces back. Interestingly, the black bars are the negative space (that absorbs light), so it's the white space between the black bars that is actually the barcode.

I found some online diagram of how information is encoded in ITF barcodes and I started work.

One of the things I learned is that the last digit on the barcode is a checksum. So, if you read the whole barcode and calculate the checksum, it should match that last digit. If it did, you're good; if it didn't, try again.

I never could get the barcode scanner to be perfect, but what I quickly realized was that you run it repeatedly – on every captured frame – and it would only take a fraction of a second for a frame to be "just right" such that the scanner would parse it the barcode correctly.

So, back to my super power: for some months following that project, I could identify ITF barcodes and parse them in my head. It was pretty cool. And short lived, since I didn't actually make use of this super power for long.

Fun job though.

Subscribe to A garage sale for your mind

Don’t miss out on the latest posts. Sign up now to get access to the library of members-only posts.
[email protected]
Subscribe