{"id":43378217,"url":"https://github.com/real-digital/gtin-validator","last_synced_at":"2026-02-02T07:16:55.539Z","repository":{"id":48605571,"uuid":"134695344","full_name":"real-digital/gtin-validator","owner":"real-digital","description":"Real GTIN Validator is a PHP library based on the GTIN specification and use SOLID principles","archived":false,"fork":false,"pushed_at":"2021-12-17T21:19:22.000Z","size":128,"stargazers_count":17,"open_issues_count":2,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-24T19:01:53.707Z","etag":null,"topics":["ean","ean-code","ean13","ean8","gtin","validation","validator"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"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/real-digital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-24T09:49:48.000Z","updated_at":"2025-02-28T21:02:14.000Z","dependencies_parsed_at":"2022-09-10T09:01:53.714Z","dependency_job_id":null,"html_url":"https://github.com/real-digital/gtin-validator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/real-digital/gtin-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/real-digital%2Fgtin-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/real-digital%2Fgtin-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/real-digital%2Fgtin-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/real-digital%2Fgtin-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/real-digital","download_url":"https://codeload.github.com/real-digital/gtin-validator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/real-digital%2Fgtin-validator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29007305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T06:37:10.400Z","status":"ssl_error","status_checked_at":"2026-02-02T06:37:09.383Z","response_time":58,"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":["ean","ean-code","ean13","ean8","gtin","validation","validator"],"created_at":"2026-02-02T07:16:54.837Z","updated_at":"2026-02-02T07:16:55.534Z","avatar_url":"https://github.com/real-digital.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real GTIN Validator\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/real-digital/gtin-validator.svg)](https://packagist.org/packages/real-digital/gtin-validator)\n[![Build Status](https://github.com/real-digital/gtin-validator/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/real-digital/gtin-validator/actions)\n[![Coverage Status](https://coveralls.io/repos/github/real-digital/gtin-validator/badge.svg?branch=master)](https://coveralls.io/github/real-digital/gtin-validator?branch=master)\n\nA GTIN is a string of digits that uniquely identifies a trade item (a product that is bought and sold). \nA GTIN is globally unique, meaning that no two products in the world share the same GTIN.\n\nThis library provides a straightforward way by which a number can be determined to be a valid GTIN\nor suspected of being invalid in some way.\n\n## Installation\n\nvia Composer\n\n``` bash\n$ composer require real-digital/gtin-validator\n```\n\nvia GitHub\n\n``` bash\n$ git clone https://github.com/real-digital/gtin-validator.git\n```\n\n### Usage\n\n```php\n\u003c?php\n\nuse Real\\Validator\\Gtin;\n\n// create a valid GTIN\n$value = '4006381333931';\n$gtin = Gtin\\Factory::create($value);\n\n\n// handle errors\n$value = 'any invalid value';\ntry {\n    $gtin = Gtin\\Factory::create($value);\n} catch (Gtin\\NonNormalizable $e) {\n    // ...\n}\n\n\n// check whether GTIN is valid\n$value = '4006381333931';\n$isValid = Gtin\\Factory::isValid($value);\n```\n\n### GTIN interface overview\n\nEach created GTIN implements a common interface. This is a complete list of its methods:\n\n| Method         | Type    | Functionality                                                      |\n|----------------|---------|--------------------------------------------------------------------|\n| `checkDigit()` | integer | Retrieve the rightmost digit called the \"Check Digit\"              |\n| `indicator()`  | integer | Retrieve the \"Indicator\" component                                 |\n| `key()`        | string  | Retrieve GTIN value having a length corresponding to its variation |\n| `length()`     | integer | Retrieve length of the variation                                   |\n| `origin()`     | string  | Retrieve an origin value used for GTIN creation                    |\n| `padded()`     | string  | Retrieve key padded to 14 digits                                   |\n| `prefix()`     | string  | Retrieve GS1 Prefix                                                |\n| `variation()`  | string  | Retrieve variation name                                            |\n\n\n## Testing\n\n``` bash\n$ composer tests\n```\n\n## License\n\nReal GTIN Validator is licensed under The Apache License 2.0. Please see [LICENSE](LICENSE) for details.\n\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freal-digital%2Fgtin-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freal-digital%2Fgtin-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freal-digital%2Fgtin-validator/lists"}