{"id":16978705,"url":"https://github.com/srph/php-luhn","last_synced_at":"2026-05-17T18:11:47.358Z","repository":{"id":28690982,"uuid":"32211091","full_name":"srph/php-luhn","owner":"srph","description":"An implementation of Luhn algorithm (aka mod-10 algorithm) to PHP","archived":false,"fork":false,"pushed_at":"2015-03-20T07:40:35.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T13:34:16.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srph.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-14T12:40:17.000Z","updated_at":"2015-03-20T07:40:35.000Z","dependencies_parsed_at":"2022-08-17T20:50:50.337Z","dependency_job_id":null,"html_url":"https://github.com/srph/php-luhn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/srph/php-luhn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fphp-luhn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fphp-luhn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fphp-luhn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fphp-luhn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srph","download_url":"https://codeload.github.com/srph/php-luhn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fphp-luhn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33149522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T01:44:02.955Z","updated_at":"2026-05-17T18:11:47.342Z","avatar_url":"https://github.com/srph.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-luhn [![Build Status](https://travis-ci.org/srph/php-luhn.svg?branch=master)](https://travis-ci.org/srph/php-luhn?branch=master) [![Latest Stable Version](https://poser.pugx.org/srph/luhn/version.svg)](https://packagist.org/packages/sroh/luhn) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)\n\nAn implementation of [Luhn algorithm (aka mod-10 algorithm)](http://en.wikipedia.org/wiki/Luhn_algorithm) to validate (verify the checksum of) credit card numbers in PHP.\n\n\\* *This was written to try out PHPUnit, but feel free to use it for anything as long as the MIT License permits*.\n\n## Installation\n\nTo install this library, simply run `composer require` in your project's root directory:\n\n```bash\n$ composer require srph/luhn\n```\n\n## Usage\n\nThis library is very easy to use! Our `function` **only** accepts one `string` argument and `return`s a `boolean`.\n\n```php\n\u003c?php\n/**\n * SRPH\\Luhn\\luhn(\u003cstring\u003e);\n */\nSRPH\\Luhn\\luhn('79927398712') =\u003e true\n?\u003e\n```\n\nFor PHP `\u003e=v5.6`, you can use the `use function` (aka `import function`) syntax:\n\n```php\n\u003c?php\nuse function SRPH\\Luhn\\luhn;\n\necho luhn('79927398712') // =\u003e true\n?\u003e\n``` \n\n## Contribution\n\nFeel free to submit any inquiry, question, issue or pull-request!\n\n### Building\n\n\\* *For contributors or for learning purposes only.*\n\n**Requirements**:\n- [PHP `\u003e=v5.x`](https://php.net) (Ehh?)\n- [Composer](https://getcomposer.org) (Install development dependencies)\n- [Git](https://git-scm.org) (To clone the repository)\n\nFirst, clone the repository, and then install the development dependencies.\n\n```bash\n$ git clone https://github.com/srph/luhn.php.git \u0026\u0026 cd luhn.php\n$ composer install\n```\n\nYou're good to go.\n\n### Automation\n\n```bash\n# ensure that you are in the root directory of the project\n$ phpunit # run tests\n```\n\n## Acknowledgement\n\n**php-luhn** © 2015+, Kier Borromeo (srph). Released under the [MIT License](https://mit-license.org).\n\n\u003e [srph.github.io](http://srph.github.io) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e GitHub [@srph](https://github.com/srph) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter [@_srph](https://twitter.com/_srph)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrph%2Fphp-luhn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrph%2Fphp-luhn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrph%2Fphp-luhn/lists"}