{"id":51124699,"url":"https://github.com/sanger/sanger_barcode_format","last_synced_at":"2026-06-25T06:01:46.244Z","repository":{"id":52298258,"uuid":"73801895","full_name":"sanger/sanger_barcode_format","owner":"sanger","description":"A ruby gem for handling the multiple format of barcodes","archived":false,"fork":false,"pushed_at":"2026-03-16T16:26:53.000Z","size":192,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"development","last_synced_at":"2026-03-17T03:52:11.559Z","etag":null,"topics":["gem","ruby"],"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/sanger.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":"2016-11-15T10:15:51.000Z","updated_at":"2021-02-12T10:58:47.000Z","dependencies_parsed_at":"2022-09-12T12:21:54.704Z","dependency_job_id":null,"html_url":"https://github.com/sanger/sanger_barcode_format","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sanger/sanger_barcode_format","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanger%2Fsanger_barcode_format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanger%2Fsanger_barcode_format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanger%2Fsanger_barcode_format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanger%2Fsanger_barcode_format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanger","download_url":"https://codeload.github.com/sanger/sanger_barcode_format/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanger%2Fsanger_barcode_format/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34761847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gem","ruby"],"created_at":"2026-06-25T06:01:45.329Z","updated_at":"2026-06-25T06:01:46.238Z","avatar_url":"https://github.com/sanger.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SBCF\n\n[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](https://www.rubydoc.info/github/sanger/sanger_barcode_format)\n![Ruby](https://github.com/sanger/sanger_barcode_format/workflows/Ruby/badge.svg)\n\n:warning: This is an early version and may be unstable.\n\nBarcodes generated by Sequencescape and other applications have two\nrepresentations, a human readable form, and an ean13 representation. The ean13\nis regularly used to generate physical barcodes, and is returned by the various\nbarcode scanners. Meanwhile the human readable form is often used when items\nare searched for manually, particularly when there is no physical access to the\nitem itself.\n\nBarcodes are comprised of three components:\n\n- A prefix: represented by two uppercase letters in the human readable form,\n  and encoded as three digits in the ean13. Please be aware that some encoded\n  prefixes begin with zero, which can get stripped under some circumstances.\n  Prefixes generally identify the type of item which has received the barcode\n  and are registered in an external database.\n- A number: A number between 0 and 9999999 inclusive. The human form is not\n  typically zero padded.\n- A checksum: In addition to the ean13 of the machine printed version,\n  barcodes also contain a single character / two digit internal checksum used to\n  identify input errors of the human readable form.\n\nIn addition, printed forms will contain the standard EAN checksum digit. This\nchecksum is included in the output of this gem and does not need to be\nrecalculated .\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'sanger_barcode_format'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install sanger_barcode_format\n\n## Usage\n\n```ruby\n  # Using builders\n  barcode = SBCF::SangerBarcode.from_human('DN12345R')\n  barcode = SBCF::SangerBarcode.from_machine(4500101234757)\n  barcode = SBCF::SangerBarcode.from_prefix_and_number('EG',123)\n\n  # Using standard initialize\n  barcode = SBCF::SangerBarcode.new(prefix:'EG',number:123)\n  barcode = SBCF::SangerBarcode.new(human_barcode:'DN12345R')\n  barcode = SBCF::SangerBarcode.new(hmachine_barcode:4500101234757)\n\n  # Converting between formats\n  barcode = SBCF::SangerBarcode.new(prefix:'PR',number:1234)\n  barcode.human_barcode # =\u003e PR1234K'\n  barcode.machine_barcode # =\u003e 4500001234757\n\n  # Pulling out components\n  barcode = SBCF::SangerBarcode.new(machine_barcode: 4500001234757)\n  barcode.prefix.human # =\u003e 'PR'\n  barcode.checksum.human # =\u003e 'K'\n```\n\n## LegacyMethods\n\nA number of legacy method are provided in the module\nSBCF::LegacyMethods. These are used to allow near drop-in\nreplacement of the barcode component of Sequencescape. They should NOT be used\nfor new applications. Legacy methods should be required explicitly, and can\nbe used to extend existing interfaces.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n4. Update the changelog\n4. Commit your changes (`git commit -am 'Added some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanger%2Fsanger_barcode_format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanger%2Fsanger_barcode_format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanger%2Fsanger_barcode_format/lists"}