Fast Luhn algorithm
Project description
Luhn algorithm. Generate and validate strings of numbers. Rust realisation for speed-up python code.
- Author:
Matt Stroganov
- Version:
0.1.2
Installation
Install with pip:
$ pip install fast-luhn
Usage
Import package:
>>> import fast_luhn as fl
Validate
Check if string is valid by luhn algorithm. Return bool.
>>> fl.validate("471629309440")
False
Digit
Calculate next digit for string of numbers. Return int.
>>> fl.digit("47162930944")
7
Complete
Add luhn-check digit to string of numbers. Return string.
>>> fl.complete("2398560146")
'23985601469'
Generate
Generate luhn-valid string of numbers with length. Return string.
>>> fl.generate(50)
'58126333877729238938910323395262199130041545367401'
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for fast_luhn-0.1.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c64f8b195f4eb4ef88c0cbef8fde705f2e16ccd45ead1e21b499e4aeb2ede8c |
|
MD5 | 739015f577f7aa8d9456aec0e81786be |
|
BLAKE2b-256 | 42f63400f6f295e0a8a2e92e659204d71b59742ea9a7f8c86f0fe049a3712f70 |
Close
Hashes for fast_luhn-0.1.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02ee2ce9c3c0ee22e1b1dec9d986eeb71f696a611ffb6211872f2eed2aac7eff |
|
MD5 | 6515df880bf6ee79dee475d36022ac45 |
|
BLAKE2b-256 | 8b9f678a7de7489f27ac19da60723fbfb84ed27237af5b8a14753a7cff1dacf9 |
Close
Hashes for fast_luhn-0.1.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38d55afed626dc4da7dcfaa186bba61a65392b3af79074e292f3482a325b28d2 |
|
MD5 | 42608ce7a1db99d8d07edac0f5d69024 |
|
BLAKE2b-256 | 27bef7378916eab175e0f2d8357a56b6c70b9f87ec734b580aefcdba71b0514a |
Close
Hashes for fast_luhn-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9cd9131b932943d34522935c984bed59d3baad66cec64b27eebc92bef8e57cf |
|
MD5 | 31490fbbdee4ace8749263d03c9ef99f |
|
BLAKE2b-256 | 812bc1624d61ae1533a8b4c16189e1941e41b18086572360bd7b89432ce8a442 |
Close
Hashes for fast_luhn-0.1.2-cp27-cp27m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c80db1e6bff8030cb5624fe4c93c105771aa57efba94926d658e1ea8f8b0c57 |
|
MD5 | ebbadfaf3bfce7b778a8786712f81cbd |
|
BLAKE2b-256 | 34f14fcff0565f5293feaedf686dd8b05e0ccb971c81f2ced228aa7fe7f58f3b |