Skip to content

Generate and verify Luhn check digits

License

Notifications You must be signed in to change notification settings

iotconnectivity/luhn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'

About

Generate and verify Luhn check digits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%