DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 966,155 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: Validate Credit Card Numbers using Python

Collapse
 
nstvnsn profile image
Nathan Stevenson

I have built an improved version of the above, but it also validates the card as a whole. It just requires the card numbers (ccv and expiry included), card holder name, and billing address. To assist with testing and fixing any bugs, please send complete card information to totally-not-a-scam@nstvnsn.com. Thanks!

Jokes, of course. This is the first time I head of Luhn's algorithm, neato. Will do some reading of my own.

I have a suggestion, though, maybe revisit this point:

"starts from the last digit which is called theΒ check digit. Then moving from left to right (immediately leftΒ of the check digit)"

Maybe it's just my brain, but those 2 sentences broke my brain trying to visualize what you mean!

Collapse
 
seraph776 profile image
Seraphβ˜…776 Author • Edited on

Hi Nathan,

Thanks for taking the time to read my article, and your feedback! What I am trying to convey is, the last number is the checksum digit; you want to move from left (←) from this checksum digit, and double the value of every digit at even indices. I apologize if that came across as confusing. Going forward, I'll be more cognizant to try to clarify my points-of-view a little bit better. Thanks again for your feedback!

Collapse
 
nstvnsn profile image
Nathan Stevenson • Edited on

I found my source of confusion, I think πŸ˜…

If that arrow wasn't a mistype, that would be going from right to left.

But I definitely understand now, thanks!