Skip to content

Latest commit

 

History

History
46 lines (28 loc) · 913 Bytes

README.rst

File metadata and controls

46 lines (28 loc) · 913 Bytes

luhn

pypi buildstatus coverage

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'