Skip to content

A simple Go program to validate credit card numbers using the Luhn algorithm.

License

Notifications You must be signed in to change notification settings

phyulwin/credit-card-validator-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Validator (Go)

A simple Go program to validate credit card numbers using the Luhn algorithm.

Features

  • Validates credit card numbers against the Luhn algorithm.
  • Identifies common card types (Visa, MasterCard, Amex, Discover, JCB).
  • Provides clear validation results.

Project Screenshots

Sample Card Numbers to Test with

Valid Card Numbers (Pass Luhn Check)

Card Type Number
Visa 4111111111111111
MasterCard 5555555555554444
Amex 378282246310005
Discover 6011111111111117
JCB 3530111333300000

Invalid Card Numbers (Fail Luhn Check)

Description Number
Wrong checksum 4111111111111121
Short 12345678
All zeros 0000000000000000
Random digits 9876543210123456

About

A simple Go program to validate credit card numbers using the Luhn algorithm.

Topics

Resources

License

Stars

Watchers

Forks