{"id":15808743,"url":"https://github.com/sqids/sqids-crystal","last_synced_at":"2025-10-04T19:45:51.556Z","repository":{"id":176746961,"uuid":"658043719","full_name":"sqids/sqids-crystal","owner":"sqids","description":"Official Crystal port of Sqids. Generate short unique IDs from numbers.","archived":false,"fork":false,"pushed_at":"2023-11-26T18:26:59.000Z","size":13,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-06T03:05:52.044Z","etag":null,"topics":["crystal","hashids","id","id-generator","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"latest_commit_sha":null,"homepage":"https://sqids.org/crystal","language":"Crystal","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/sqids.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":"2023-06-24T15:35:00.000Z","updated_at":"2024-04-04T05:48:27.000Z","dependencies_parsed_at":"2024-10-26T09:09:16.754Z","dependency_job_id":"d7604a62-da75-42d0-a796-7124119413e4","html_url":"https://github.com/sqids/sqids-crystal","commit_stats":null,"previous_names":["sqids/sqids-crystal"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sqids/sqids-crystal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-crystal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-crystal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-crystal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-crystal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqids","download_url":"https://codeload.github.com/sqids/sqids-crystal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-crystal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278366611,"owners_count":25975091,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":["crystal","hashids","id","id-generator","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"created_at":"2024-10-05T03:06:24.018Z","updated_at":"2025-10-04T19:45:51.515Z","avatar_url":"https://github.com/sqids.png","language":"Crystal","funding_links":[],"categories":["Crystal"],"sub_categories":[],"readme":"# [Sqids Crystal](https://sqids.org/crystal)\n\nSqids (pronounced \"squids\") is a small library that lets you generate YouTube-looking IDs from numbers. It's good for link shortening, fast \u0026 URL-safe ID generation and decoding back into numbers for quicker database lookups.\n\n## Getting started\n\nAdd the dependency to your `shard.yml`:\n\n```yaml\ndependencies:\n  sqids:\n    github: sqids/sqids-crystal\n```\n\nAnd then execute:\n\n```sh\nshards install\n```\n\n## Examples\n\nSimple encode \u0026 decode:\n\n```crystal\nsqids = Sqids.new\nid = sqids.encode([1, 2, 3]) # \"86Rf07\"\nnumbers = sqids.decode(id) # [1, 2, 3]\n```\n\n\u003e **Note**\n\u003e 🚧 Because of the algorithm's design, **multiple IDs can decode back into the same sequence of numbers**. If it's important to your design that IDs are canonical, you have to manually re-encode decoded numbers and check that the generated ID matches.\n\nEnforce a *minimum* length for IDs:\n\n```crystal\nsqids = Sqids.new(min_length: 10)\nid = sqids.encode([1, 2, 3]) # \"86Rf07xd4z\"\nnumbers = sqids.decode(id) # [1, 2, 3]\n```\n\nRandomize IDs by providing a custom alphabet:\n\n```crystal\nsqids = Sqids.new(alphabet: \"FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE\")\nid = sqids.encode([1, 2, 3]) # \"B4aajs\"\nnumbers = sqids.decode(id) # [1, 2, 3]\n```\n\nPrevent specific words from appearing anywhere in the auto-generated IDs:\n\n```crystal\nsqids = Sqids.new(blocklist: Set.new(%w[86Rf07]))\nid = sqids.encode([1, 2, 3]) # \"se8ojk\"\nnumbers = sqids.decode(id) # [1, 2, 3]\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-crystal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqids%2Fsqids-crystal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-crystal/lists"}