{"id":28566802,"url":"https://github.com/salsify/salsify-gtin","last_synced_at":"2025-06-10T15:39:09.463Z","repository":{"id":45986682,"uuid":"168401303","full_name":"salsify/salsify-gtin","owner":"salsify","description":"Validates and converts GTIN variants to standardized GTIN-14 representation","archived":false,"fork":false,"pushed_at":"2021-11-22T20:29:49.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-24T20:22:33.746Z","etag":null,"topics":["gem"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salsify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-01-30T19:25:18.000Z","updated_at":"2022-03-09T04:18:09.000Z","dependencies_parsed_at":"2022-09-16T07:12:12.803Z","dependency_job_id":null,"html_url":"https://github.com/salsify/salsify-gtin","commit_stats":null,"previous_names":["salsify/gtin"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Fsalsify-gtin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Fsalsify-gtin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Fsalsify-gtin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Fsalsify-gtin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salsify","download_url":"https://codeload.github.com/salsify/salsify-gtin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salsify%2Fsalsify-gtin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259104088,"owners_count":22805805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gem"],"created_at":"2025-06-10T15:39:06.557Z","updated_at":"2025-06-10T15:39:09.440Z","avatar_url":"https://github.com/salsify.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GTIN\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'salsify-gtin'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install salsify-gtin\n\nAnd load it with:\n\n    $ require 'gtin'\n\n## Usage\n\nThis gem is all about validating GTIN-compatible identifiers and converting\nthem to a standardized GTIN-14 representation. Supported input types include\nGTIN, EAN-13, UPC-A, UPC-E, ISBN-10, ISBN-13, and ISSN. Inputs must be strings\ncontaining only digits and include the check digit (see examples below).\n\n### Examples:\n\n```\n# UPC-A\nGTIN.to_gtin('UPC', '123412341230') =\u003e '00123412341230'\nGTIN.compute_checksum_gtin('12341234123') =\u003e'0' # UPC-A is a subset of GTIN\nGTIN.compute_checksum_gtin('0012341234123') =\u003e'0'\n\n# UPC-E\nGTIN.to_gtin('UPC', '1236432') =\u003e '00012300000642'\n\n# ISBN-10\nGTIN.to_gtin('ISBN', '0306406152') =\u003e '09780306406157'\nGTIN.compute_checksum_isbn10('030640615') =\u003e'2'\nGTIN.compute_checksum_gtin('0978030640615') =\u003e'7' # ISBN-13 is a subset of GTIN\n\n# ISBN-13 with an incorrect check digit\nGTIN.to_gtin('ISBN', '9780306406150') =\u003e GtinValidationError (invalid checksum)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then,\nrun `rake spec` to run the tests. You can also run `bin/console` for an\ninteractive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. \n\nTo release a new version, update the version number in `version.rb`, and then\nrun `bundle exec rake release`, which will create a git tag for the version,\npush git commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org)\n.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/salsify/gtin\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalsify%2Fsalsify-gtin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalsify%2Fsalsify-gtin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalsify%2Fsalsify-gtin/lists"}