Skip to main content

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.

Source Distribution

luhn-0.2.0.tar.gz (1.7 kB view details)

Uploaded Source

File details

Details for the file luhn-0.2.0.tar.gz.

File metadata

  • Download URL: luhn-0.2.0.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for luhn-0.2.0.tar.gz
Algorithm Hash digest
SHA256 917174cecce8bcbbe56ac0d904dbedd06594b21b6f31d5a3ec161d455b0e59f7
MD5 7b59c7201b5ca8a9e458d923e6ba9e37
BLAKE2b-256 b2de2e989e69fdc81222fd0015f0e9e6899d32e7feea3e5f43267d60a3431163

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page