https://github.com/jatiinyadav/luhn-algorithm
Luhn's Algorithm in various programming languages.
https://github.com/jatiinyadav/luhn-algorithm
csharp golang java javascript luhn-algorithm python3 rust
Last synced: 2 months ago
JSON representation
Luhn's Algorithm in various programming languages.
- Host: GitHub
- URL: https://github.com/jatiinyadav/luhn-algorithm
- Owner: jatiinyadav
- Created: 2021-06-11T04:14:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-09-07T11:01:01.000Z (8 months ago)
- Last Synced: 2024-12-19T17:20:01.060Z (4 months ago)
- Topics: csharp, golang, java, javascript, luhn-algorithm, python3, rust
- Language: Java
- Homepage:
- Size: 7.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Credit Card Checksum Validation 🏦
This repository contains implementations of a credit card checksum validation algorithm across multiple programming languages. The algorithm used is the Luhn algorithm, which is commonly employed to validate credit card numbers.## Algorithm Overview 🔍
The Luhn algorithm (or "modulus 10" algorithm) is a simple checksum formula used to validate various identification numbers, especially credit card numbers. The algorithm works by:1. Doubling every second digit from the right (starting with the second-to-last digit) 🔢.
2. Subtracting 9 from any result that is greater than 9 ✂️.
3. Summing all the digits ➕.
4. Checking if the total sum is divisible by 10 🔄.
5. If the total sum is divisible by 10, the credit card number is considered valid ✅.## Implementations 🛠️
This repository includes implementations of the Luhn algorithm in the following programming languages:- Python 🐍
- Java ☕
- C# 🔧
- JavaScript 💎
- Go 🚀
- Rust 🦀Each implementation provides a function to validate a credit card number using the Luhn algorithm.
## Contributing 🤝
Contributions to improve or add new language implementations are welcome. Please feel free to submit pull requests or open issues if you encounter any problems or have suggestions for enhancements.