Basic Implementation for Luhn AlgorithmUseful for Verifying Credit Cards.
Use pip install pyluhn
or python setup.py install
.
verify
checks whether the given string is a valid
Luhn string in the given base. By default, base is 10:
>>> from pyluhn import verify
>>> verify('5105105105105100') # MasterCard Test Card
True
>>> verify('5105105105105101') # Test Number
False