Generate and verify Luhn check digits
Project description
Generate and verify Luhn check digits
Install with
pip install luhn
Use verify to check digit strings
>>> from luhn import *
>>> verify('356938035643809')
True
>>> verify('534618613411236')
False
and use generate to produce them
>>> generate('53461861341123')
4
or append for convenience
>>> append('53461861341123')
'534618613411234'
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
luhn-0.2.0.tar.gz
(1.7 kB
view hashes)