Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Different Credit cards and their lengths Credit Card Name Length AMEX MASTERCARD VISA DISCOVER DINERS CLUB/ CARTE BLANCHE 15 16 13 and 16 16

image text in transcribed

Different Credit cards and their lengths Credit Card Name Length AMEX MASTERCARD VISA DISCOVER DINERS CLUB/ CARTE BLANCHE 15 16 13 and 16 16 14 Actually, credit card numbers have some structure to them. American Express numbers all start with 34 or 37; MasterCard numbers all start with 51, 52, 53, 54, or 55; Visa numbers all start with 4; Discover numbers all start with 6011; and Diners Club (Carte Blanche) numbers start with 300, 301, 302, 303, 304, 305, 36, or 38. But credit card numbers also have a "checksum" built into them, a mathematical relationship between at least one number and others. That checksum enables computers (or humans who like math) to: detect typos (e.g., transpositions), if not fraudulent numbers, without having to query a database, which can be slow. (Consider the awkward silence you may have experienced at some point while paying by credit card at a store whose computer uses a dialup modem to verify your card.) Of course, a dishonest mathematician could certainly craft a fake number that nonetheless respects the mathematical constraint, so a database lookup is still necessary for more rigorous checks. So what's the secret formula? Well, most cards use an algorithm invented by Hans Peter Luhn, a nice fellow from IBM. According to Luhn's algorithm, you can determine if a credit card number is (syntactically) valid as follows: 1. Multiply every other digit by 2, starting with the number's second- to-last digit, and then add those products' digits together. 2. Add the sum to the sum of the digits that weren't multiplied by 2.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managers and the Legal Environment Strategies for the 21st Century

Authors: Constance E Bagley, Diane W Savage

6th Edition

978-1439033814, 1439033811, 324582048, 978-0324582048

More Books

Students also viewed these Programming questions

Question

Use lHpitals rule to find the limit. 31 + 3 43 14t - t + 3 lim

Answered: 1 week ago