{"id":20904705,"url":"https://github.com/sage/guid_spanner","last_synced_at":"2025-05-13T05:30:48.285Z","repository":{"id":137383626,"uuid":"101374996","full_name":"Sage/guid_spanner","owner":"Sage","description":"Packs, unpacks and converts 32 and 36 bit and binary uuids","archived":true,"fork":false,"pushed_at":"2018-08-22T13:18:51.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-12T21:28:11.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sage.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-25T06:51:22.000Z","updated_at":"2024-03-21T12:15:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e402f3c-4bf7-45d9-ba1e-96623d7a2b7b","html_url":"https://github.com/Sage/guid_spanner","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fguid_spanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fguid_spanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fguid_spanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sage%2Fguid_spanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sage","download_url":"https://codeload.github.com/Sage/guid_spanner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253882718,"owners_count":21978540,"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":[],"created_at":"2024-11-18T13:18:34.421Z","updated_at":"2025-05-13T05:30:48.276Z","avatar_url":"https://github.com/Sage.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# guid_spanner\n\n[![Travis Status](https://travis-ci.org/Sage/guid_spanner.svg?branch=master)](https://travis-ci.org/Sage/guid_spanner)\n[![Maintainability](https://api.codeclimate.com/v1/badges/8d12a8e1ea18edf6297c/maintainability)](https://codeclimate.com/github/Sage/guid_spanner/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/8d12a8e1ea18edf6297c/test_coverage)](https://codeclimate.com/github/Sage/guid_spanner/test_coverage)\n[![Gem Version](https://badge.fury.io/rb/guid_spanner.png)](http://badge.fury.io/rb/guid_spanner)\n\nPacks and unpacks 32(compact) and 36 charactor GUIDs\n\n# Install\n```ruby\nrequire 'guid_spanner'\n```\n```ruby\nbundle\n```\n\n# Usage\n## Unpack a 32 GUID to 36\n```ruby\nGuidSpanner::Guid.unpack_to_36('1be7eaa5aba341e895a653e66be98fef')\n=\u003e '1be7eaa5-aba3-41e8-95a6-53e66be98fef'\n```\n## Pack a 36 char GUID to 32\n```ruby\nGuidSpanner::Guid.pack_to_32('1be7eaa5-aba3-41e8-95a6-53e66be98fef')\n=\u003e '1be7eaa5aba341e895a653e66be98fef'\n```\n## Convert a 36 char GUID to binary\n```ruby\nGuidSpanner::Guid.str_to_bin('1be7eaa5-aba3-41e8-95a6-53e66be98fef')\n=\u003e '\\e\\xE7\\xEA\\xA5\\xAB\\xA3A\\xE8\\x95\\xA6S\\xE6k\\xE9\\x8F\\xEF'\n```\n## Convert a binary GUID to 36 char\n```ruby\nGuidSpanner::Guid.bin_to_str('\\e\\xE7\\xEA\\xA5\\xAB\\xA3A\\xE8\\x95\\xA6S\\xE6k\\xE9\\x8F\\xEF')\n=\u003e '1be7eaa5-aba3-41e8-95a6-53e66be98fef'\n```\n# Exceptions\nRaises\n```ruby\nGuidSpanner::Exceptions::InvalidUuidFormatError\n```\nif an incorrectly formatted GUID is provided for packing or unpacking or conversion\n\n## Licence\n\nGuid Spanner is licensed under the [Apache-2.0 licence](https://github.com/Sage/guid_spanner/blob/master/LICENSE).\n\nCopyright (c) 2018 Sage Group Plc. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsage%2Fguid_spanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsage%2Fguid_spanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsage%2Fguid_spanner/lists"}