Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Generate and verify Luhn check digits

Project description

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'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for luhn, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size luhn-0.2.0.tar.gz (1.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page