Simple credit card validator using Luna algorithm
Project description
Credit Card Validator
This Python module provides a function to validate credit card numbers using the Luhn algorithm.
Installation
No installation is required. Simply copy the validator.py file into your project.
Usage
Import the validate function from the module and use it to check if a credit card number is valid.
Example
from validator import validatorLuhn
# Example credit card numbers
card_number1 = "4539 1488 0343 6467" # Valid Visa card number
card_number2 = "8273 1232 7352 0569" # Invalid card number
# Validate the card numbers
is_valid1 = validatorLuhn.validate(card_number1)
is_valid2 = validatorLuhn.validate(card_number2)
print(f"Card number {card_number1} is valid: {is_valid1}")
print(f"Card number {card_number2} is valid: {is_valid2}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
validator_luhn-0.1.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for validator_luhn-0.1.1-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | fd3d871b398de53b27417a86a21a399a5a8a2bf07caeea86f8cf7da3e4ebe3ff |
|
| MD5 | 4b7212d12a913ef25347e31719241e91 |
|
| BLAKE2b-256 | dda0caeda40636497c2b440e789f17492f0c3af9749e5ad98b7524f9b775f592 |