The Luhn Algorithm

When The Economist isn’t shilling for unconditional free trade and occupying Iraq, it contains interesting technology and science stories. I had no idea there was a “solution” to credit card numbers as this article demonstrates the Luhn algorithm. I tried it with my Vegas card and got 73! Then I realized I entered one number incorrectly so the algorithm is correct.

I was (easily) impressed because I always figured the last 12 numbers were random with the first four identifying the card issuer. So verification was done through the computer on the other end of the transaction. Modern computers can plow through billions of numbers (or operations) a second, how long could it take to match up a 16-digit string with a name and expiration date? I think this explains why the card is accepted quickly while the purchase requires a couple days to be posted on my online statement.

This entry was posted in Factoids. Bookmark the permalink.

Leave a Reply