{ "info": { "author": "Matt Stroganov", "author_email": "strmatvey@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Rust" ], "description": "=========\nfast-luhn\n=========\n\nLuhn-algorithm_. Generate and validate strings of numbers. \nIt is used for account number validation, credit card validation, data verification, cryptography, decoding, etcetera.\nRust realization for speed-up python code. See benchmark_ for details.\n\n.. _Luhn-algorithm: https://en.wikipedia.org/wiki/Luhn_algorithm\n\n:Author: Matt Stroganov\n:Version: 0.1.3\n\n\nInstallation\n============\nInstall with pip:\n\n::\n\n $ pip install fast-luhn\n\nUsage\n=====\nImport package:\n\n.. code:: python\n\n >>> import fast_luhn as fl\n\nValidate\n--------\nCheck if *string* is valid by luhn algorithm. Return *bool*.\n\n.. code:: python\n\n >>> fl.validate(\"471629309440\")\n False\n\nDigit\n--------\nCalculate next digit for string of numbers. Return *int*.\n\n.. code:: python\n\n >>> fl.digit(\"47162930944\")\n 7\n\nComplete\n--------\nAdd luhn-check digit to string of numbers. Return *string*.\n\n.. code:: python\n\n >>> fl.complete(\"2398560146\")\n '23985601469'\n\nGenerate\n--------\nGenerate luhn-valid string of numbers with *length*. Return *string*.\n\n.. code:: python\n\n >>> fl.generate(50)\n '58126333877729238938910323395262199130041545367401'\n\nBuild\n=====\nInstall from sources:\n\n::\n\n $ git clone https://github.com/cybermatt/fast-luhn\n $ cd fast-luhn\n $ pip install -r requirements-dev.txt\n $ python ./setup.py develop\n\n\nBenchmark\n=========\n\nPure python realization (from here_) was very slow.\n\n.. _here: https://stackoverflow.com/questions/21079439/implementation-of-luhn-formula\n\nComparison with popular python Luhn modules:\n\n+--------------+------------+-----------+------------+\n| method \\ lib | luhn_ | LAP_ | fast-luhn |\n+==============+============+===========+============+\n| validate | 4.65 \u00b5s | 13.3 \u00b5s | **0.2 \u00b5s** |\n+--------------+------------+-----------+------------+\n| generate | 48.1 \u00b5s | 94.4 \u00b5s | **3.17 \u00b5s**|\n+--------------+------------+-----------+------------+\n\n.. _luhn: https://github.com/mmcloughlin/luhn\n.. _LAP: https://github.com/garwoodpr/LuhnAlgorithmProof\n\nEnvironment:\n\n* CPU i5-6500 3.20GHz, 16gb RAM\n* Linux 4.19\n* Python 3.7.3\n\n\nTests\n=====\n\n::\n\n $ pytest -v tests.py \n\n\nLicense\n=======\n\nThis project is licensed under the MIT License - see the LICENSE.txt_ file for details\n\n.. _LICENSE.txt: LICENSE.txt\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/cybermatt/fast-luhn", "keywords": "luhn validation", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "fast-luhn", "package_url": "https://pypi.org/project/fast-luhn/", "platform": "", "project_url": "https://pypi.org/project/fast-luhn/", "project_urls": { "Homepage": "https://github.com/cybermatt/fast-luhn" }, "release_url": "https://pypi.org/project/fast-luhn/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Fast Luhn algorithm", "version": "0.1.3" }, "last_serial": 5138283, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "ebbadfaf3bfce7b778a8786712f81cbd", "sha256": "9c80db1e6bff8030cb5624fe4c93c105771aa57efba94926d658e1ea8f8b0c57" }, "downloads": -1, "filename": "fast_luhn-0.1.2-cp27-cp27m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "ebbadfaf3bfce7b778a8786712f81cbd", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150163, "upload_time": "2019-04-09T20:02:06", "url": "https://files.pythonhosted.org/packages/34/f1/4fcff0565f5293feaedf686dd8b05e0ccb971c81f2ced228aa7fe7f58f3b/fast_luhn-0.1.2-cp27-cp27m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "31490fbbdee4ace8749263d03c9ef99f", "sha256": "d9cd9131b932943d34522935c984bed59d3baad66cec64b27eebc92bef8e57cf" }, "downloads": -1, "filename": "fast_luhn-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "31490fbbdee4ace8749263d03c9ef99f", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150153, "upload_time": "2019-04-09T20:02:08", "url": "https://files.pythonhosted.org/packages/81/2b/c1624d61ae1533a8b4c16189e1941e41b18086572360bd7b89432ce8a442/fast_luhn-0.1.2-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "42608ce7a1db99d8d07edac0f5d69024", "sha256": "38d55afed626dc4da7dcfaa186bba61a65392b3af79074e292f3482a325b28d2" }, "downloads": -1, "filename": "fast_luhn-0.1.2-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "42608ce7a1db99d8d07edac0f5d69024", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 296878, "upload_time": "2019-04-09T20:02:10", "url": "https://files.pythonhosted.org/packages/27/be/f7378916eab175e0f2d8357a56b6c70b9f87ec734b580aefcdba71b0514a/fast_luhn-0.1.2-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "6515df880bf6ee79dee475d36022ac45", "sha256": "02ee2ce9c3c0ee22e1b1dec9d986eeb71f696a611ffb6211872f2eed2aac7eff" }, "downloads": -1, "filename": "fast_luhn-0.1.2-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "6515df880bf6ee79dee475d36022ac45", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 443583, "upload_time": "2019-04-09T20:02:12", "url": "https://files.pythonhosted.org/packages/8b/9f/678a7de7489f27ac19da60723fbfb84ed27237af5b8a14753a7cff1dacf9/fast_luhn-0.1.2-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "739015f577f7aa8d9456aec0e81786be", "sha256": "3c64f8b195f4eb4ef88c0cbef8fde705f2e16ccd45ead1e21b499e4aeb2ede8c" }, "downloads": -1, "filename": "fast_luhn-0.1.2-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "739015f577f7aa8d9456aec0e81786be", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 590276, "upload_time": "2019-04-09T20:02:14", "url": "https://files.pythonhosted.org/packages/42/f6/3400f6f295e0a8a2e92e659204d71b59742ea9a7f8c86f0fe049a3712f70/fast_luhn-0.1.2-cp37-cp37m-manylinux1_x86_64.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e8deb6e2f6e5a29c2cebb933f96b3eb9", "sha256": "58e25f05fd8581c3caab8fad5983ac8185a12ec47d23aba5f56613b3addd9b10" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp27-cp27m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "e8deb6e2f6e5a29c2cebb933f96b3eb9", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150660, "upload_time": "2019-04-13T14:44:57", "url": "https://files.pythonhosted.org/packages/6e/02/92c308481c1ed7a784975bc1dbeafe2eb0ef4a5e81f269e7911b7dbb4cd2/fast_luhn-0.1.3-cp27-cp27m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "9ab2c7027a8ebba2b086e21460bcd1c2", "sha256": "28819db3dee6bf7cff2e22f046770f49adbed4bbc40533ce06c946fadc0e15d5" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "9ab2c7027a8ebba2b086e21460bcd1c2", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150668, "upload_time": "2019-04-13T14:44:59", "url": "https://files.pythonhosted.org/packages/19/08/a47c10f88041f115dae54d5598c14a8dadb774dccc791574752e2bc21fec/fast_luhn-0.1.3-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3dd9ee2d12bfa9e72c57ef5e1dd6b915", "sha256": "dd136accebd715f9300b1458a4d79984ae0cae7666e1774f85828dba2c0430b2" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "3dd9ee2d12bfa9e72c57ef5e1dd6b915", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 297376, "upload_time": "2019-04-13T14:45:01", "url": "https://files.pythonhosted.org/packages/dd/3a/4b9261241a6191d1b963bb2ac6952a20d5c32bdc0f697a5fde49e227b09d/fast_luhn-0.1.3-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "c6c5a7118f87ec2735c02f8c36b2c6a5", "sha256": "544856c195592c65a48fef8a2b93458d884a42b8f2e6afe4561b337d57ff2e2c" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "c6c5a7118f87ec2735c02f8c36b2c6a5", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 444068, "upload_time": "2019-04-13T14:45:03", "url": "https://files.pythonhosted.org/packages/e6/5b/39b4d858f435accecb11a8021a2b32b6cae0060b9be4f11fff42a3ee2f3f/fast_luhn-0.1.3-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "41d52a437c71959b1a937ed6d3cc1124", "sha256": "ea295b75834d2edff32937c864b1b78d6d0a3f21dc6de01fea239489e7f84e00" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "41d52a437c71959b1a937ed6d3cc1124", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 590699, "upload_time": "2019-04-13T14:45:05", "url": "https://files.pythonhosted.org/packages/58/4d/e5db52bafdbf004f4a03cbd5064f66fb6159c87a350f38cfc36ca87dd870/fast_luhn-0.1.3-cp37-cp37m-manylinux1_x86_64.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e8deb6e2f6e5a29c2cebb933f96b3eb9", "sha256": "58e25f05fd8581c3caab8fad5983ac8185a12ec47d23aba5f56613b3addd9b10" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp27-cp27m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "e8deb6e2f6e5a29c2cebb933f96b3eb9", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150660, "upload_time": "2019-04-13T14:44:57", "url": "https://files.pythonhosted.org/packages/6e/02/92c308481c1ed7a784975bc1dbeafe2eb0ef4a5e81f269e7911b7dbb4cd2/fast_luhn-0.1.3-cp27-cp27m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "9ab2c7027a8ebba2b086e21460bcd1c2", "sha256": "28819db3dee6bf7cff2e22f046770f49adbed4bbc40533ce06c946fadc0e15d5" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp27-cp27mu-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "9ab2c7027a8ebba2b086e21460bcd1c2", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 150668, "upload_time": "2019-04-13T14:44:59", "url": "https://files.pythonhosted.org/packages/19/08/a47c10f88041f115dae54d5598c14a8dadb774dccc791574752e2bc21fec/fast_luhn-0.1.3-cp27-cp27mu-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "3dd9ee2d12bfa9e72c57ef5e1dd6b915", "sha256": "dd136accebd715f9300b1458a4d79984ae0cae7666e1774f85828dba2c0430b2" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp35-cp35m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "3dd9ee2d12bfa9e72c57ef5e1dd6b915", "packagetype": "bdist_wheel", "python_version": "cp35", "requires_python": null, "size": 297376, "upload_time": "2019-04-13T14:45:01", "url": "https://files.pythonhosted.org/packages/dd/3a/4b9261241a6191d1b963bb2ac6952a20d5c32bdc0f697a5fde49e227b09d/fast_luhn-0.1.3-cp35-cp35m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "c6c5a7118f87ec2735c02f8c36b2c6a5", "sha256": "544856c195592c65a48fef8a2b93458d884a42b8f2e6afe4561b337d57ff2e2c" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp36-cp36m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "c6c5a7118f87ec2735c02f8c36b2c6a5", "packagetype": "bdist_wheel", "python_version": "cp36", "requires_python": null, "size": 444068, "upload_time": "2019-04-13T14:45:03", "url": "https://files.pythonhosted.org/packages/e6/5b/39b4d858f435accecb11a8021a2b32b6cae0060b9be4f11fff42a3ee2f3f/fast_luhn-0.1.3-cp36-cp36m-manylinux1_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "41d52a437c71959b1a937ed6d3cc1124", "sha256": "ea295b75834d2edff32937c864b1b78d6d0a3f21dc6de01fea239489e7f84e00" }, "downloads": -1, "filename": "fast_luhn-0.1.3-cp37-cp37m-manylinux1_x86_64.whl", "has_sig": false, "md5_digest": "41d52a437c71959b1a937ed6d3cc1124", "packagetype": "bdist_wheel", "python_version": "cp37", "requires_python": null, "size": 590699, "upload_time": "2019-04-13T14:45:05", "url": "https://files.pythonhosted.org/packages/58/4d/e5db52bafdbf004f4a03cbd5064f66fb6159c87a350f38cfc36ca87dd870/fast_luhn-0.1.3-cp37-cp37m-manylinux1_x86_64.whl" } ] }