Git Product home page Git Product logo

creditcardchecker's Introduction

Credit Card Checker

This is a small command line utility offering some functions related to credit card number validation.

With it, you can:

  • Generate valid credit card numbers
  • Check which companies cards belong to
  • Check if an entered number is valid

How the Algorithm Works

Credit card and debit card numbers are checked with Luhn's Algorithm, a checksum formula used to catch simple transcription errors in card numbers when they're entered. It's not perfect; if too many digits are changed, or switched, then it may incorrectly verify a number as correct.

The algorithm relies on doubling every even digit in the number, adding the individual results together (so 6 * 2 = 12, and 1+2 = 3), adding all of those results, and then comparing the mod of that sum with the check digit. In the case of a credit card number, that check digit is the last number in the credit card number.

Different card companies have certain lead numbers. for example, Visa card numbers all start with 4. By checking which digits a given card number begins with, the type of card can be identified. Not all card number ranges are used, as only specific numbers are associated with companies.

For a more thorough explanation of how this algorithm works, with a few examples, the Wikipedia article on the subject is quite good.

Usage:

  • -H -- Help/Usage
  • -K -- Generate a valid card number with a valid company
  • -U -- Generate a valid card number with an unknown company
  • -C -- Check a given card number for validity (ex. python main.py -C 94304056966994)

creditcardchecker's People

Contributors

jordanwdunne avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.