{"id":22683297,"url":"https://github.com/mtchavez/ex_cc_validation","last_synced_at":"2026-03-07T07:32:42.356Z","repository":{"id":48306260,"uuid":"95055675","full_name":"mtchavez/ex_cc_validation","owner":"mtchavez","description":"CC Validation in Elixir","archived":false,"fork":false,"pushed_at":"2021-08-02T13:22:00.000Z","size":61,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:31:49.165Z","etag":null,"topics":["cc-validation","credit-card-validation","elixir","elixir-cc-validation","elixir-credit-card-validation","luhn-algorithm"],"latest_commit_sha":null,"homepage":"https://gitlab.com/mtchavez/ex_cc_validation","language":"Elixir","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtchavez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-21T23:42:04.000Z","updated_at":"2023-05-14T14:40:42.000Z","dependencies_parsed_at":"2022-08-22T11:40:38.305Z","dependency_job_id":null,"html_url":"https://github.com/mtchavez/ex_cc_validation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mtchavez/ex_cc_validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fex_cc_validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fex_cc_validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fex_cc_validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fex_cc_validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtchavez","download_url":"https://codeload.github.com/mtchavez/ex_cc_validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtchavez%2Fex_cc_validation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209732,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: 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":["cc-validation","credit-card-validation","elixir","elixir-cc-validation","elixir-credit-card-validation","luhn-algorithm"],"created_at":"2024-12-09T21:11:32.232Z","updated_at":"2026-03-07T07:32:42.343Z","avatar_url":"https://github.com/mtchavez.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CcValidation\n\n[![Hex Version](https://img.shields.io/hexpm/v/cc_validation.svg)](https://hex.pm/packages/cc_validation)\n[![build status](https://gitlab.com/mtchavez/ex_cc_validation/badges/master/build.svg)](https://gitlab.com/mtchavez/ex_cc_validation/commits/master)\n[![coverage report](https://gitlab.com/mtchavez/ex_cc_validation/badges/master/coverage.svg)](https://gitlab.com/mtchavez/ex_cc_validation/commits/master)\n\nCredit Card format validation\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `cc_validation` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:cc_validation, \"~\u003e 0.1.0\"}]\nend\n```\n\n## Usage\n\n### Validate a card number\n\nValid credit card\n\n```elixir\niex\u003e CcValidation.validate(\"4716892095589823\")\n{:ok, true}\n````\n\nInvalid credit card\n\n```elixir\niex\u003e CcValidation.validate(\"4024007106963124\")\n{:error, false}\n````\n\nTest card returns false\n\n```elixir\niex\u003e CcValidation.validate(\"4111111111111111\")\n{:error, false}\n````\n\n### Validate test card numbers when check_test_numbers is true\n\nA valid test card\n\n```elixir\niex\u003e CcValidation.validate(\"4111111111111111\", true)\n{:ok, true, test_number: true}\n````\n\nAn invalid test card\n\n```elixir\niex\u003e CcValidation.validate(\"4212121212121212\", true)\n{:error, false, test_number: false}\n````\n\nA valid card when checking for test numbers just passes through\nto the validate function but will also return that it is not\na test card\n\n```elixir\niex\u003e CcValidation.validate(\"4716892095589823\", true)\n{:ok, true, test_number: false}\n````\n\n### Card numbers that are of length less than 13 or greater than 19 are invalid.\n\n```elixir\niex\u003e CcValidation.validate(\"123\")\n{:error, false}\n\niex\u003e CcValidation.validate(\"12345678901234567890\")\n{:error, false}\n````\n\n## Tests\n\nTests can be ran with `mix` by running `mix test`\n\n## Documentation\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/cc_validation](https://hexdocs.pm/cc_validation).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fex_cc_validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtchavez%2Fex_cc_validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtchavez%2Fex_cc_validation/lists"}