{"id":35228497,"url":"https://github.com/sqids/sqids-scala","last_synced_at":"2026-04-02T18:45:33.195Z","repository":{"id":176746999,"uuid":"658042118","full_name":"sqids/sqids-scala","owner":"sqids","description":"Official Scala port of Sqids. Generate short unique IDs from numbers.","archived":false,"fork":false,"pushed_at":"2025-02-18T09:01:18.000Z","size":63,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-18T09:22:19.759Z","etag":null,"topics":["hashids","id","id-generator","scala","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"latest_commit_sha":null,"homepage":"https://sqids.org/scala","language":"Scala","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":null,"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:29:40.000Z","updated_at":"2025-02-18T08:01:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"d073b345-0901-456b-84cc-d1b4f47c8e3e","html_url":"https://github.com/sqids/sqids-scala","commit_stats":null,"previous_names":["sqids/sqids-scala"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sqids/sqids-scala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-scala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-scala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-scala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-scala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sqids","download_url":"https://codeload.github.com/sqids/sqids-scala/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sqids%2Fsqids-scala/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["hashids","id","id-generator","scala","short-id","short-url","sqids","uid","unique-id","unique-id-generator"],"created_at":"2025-12-30T01:56:54.030Z","updated_at":"2026-04-02T18:45:33.190Z","avatar_url":"https://github.com/sqids.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Sqids Scala](https://sqids.org/scala)\n\n[![Release](https://index.scala-lang.org/sqids/sqids-scala/latest.svg?color=orange)](https://index.scala-lang.org/sqids/sqids-scala)\n[![Tests](https://github.com/sqids/sqids-scala/actions/workflows/ci.yml/badge.svg)](https://github.com/sqids/sqids-scala/actions/workflows/ci.yml) \n[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/sqids/sqids-scala/blob/main/LICENSE)\n\n[Sqids](https://sqids.org/scala) (*pronounced \"squids\"*) is a small library that lets you **generate unique 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\nFeatures:\n\n- **Encode multiple numbers** - generate short IDs from one or several non-negative numbers\n- **Quick decoding** - easily decode IDs back into numbers\n- **Unique IDs** - generate unique IDs by shuffling the alphabet once\n- **ID padding** - provide minimum length to make IDs more uniform\n- **URL safe** - auto-generated IDs do not contain common profanity\n- **Randomized output** - Sequential input provides nonconsecutive IDs\n- **Many implementations** - Support for [40+ programming languages](https://sqids.org/)\n\n## 🧰 Use-cases\n\nGood for:\n\n- Generating IDs for public URLs (eg: link shortening)\n- Generating IDs for internal systems (eg: event tracking)\n- Decoding for quicker database lookups (eg: by primary keys)\n\nNot good for:\n\n- Sensitive data (this is not an encryption library)\n- User IDs (can be decoded revealing user count)\n\n## 🚀 Getting started\n\nInclude in build.sbt:\n\n```scala\nlibraryDependencies ++= \"org.sqids\" %% \"sqids\" % \"0.6.0\"\n```\n\n## 👩‍💻 Examples\n\nSimple encode \u0026 decode:\n\n```scala\nimport sqids.Sqids\nval sqids = Sqids.default\nval id = sqids.encodeUnsafeString(1, 2, 3)\n// id: String = \"86Rf07\"\nval numbers = sqids.decode(id) \n// numbers: List[Int] = List(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\nRandomize IDs by providing a custom alphabet:\n\n```scala\nimport sqids.options.Alphabet\nimport sqids.Sqids\n\nAlphabet(\"FxnXM1kBN6cuhsAvjW3Co7l2RePyY8DwaU04Tzt9fHQrqSVKdpimLGIJOgb5ZE\")\n  .flatMap(Sqids.forAlphabet)\n  .foreach { sqids =\u003e\n    val id = sqids.encodeUnsafeString(1, 2, 3)\n    println(id) \n    // B4aajs\n    println(sqids.decode(id)) \n    // List(1, 2, 3)\n  }\n```\n\nEnforce a *minimum* length for IDs:\n\n```scala\nimport sqids.Sqids\n\nSqids\n  .withMinLength(10)\n  .foreach { sqids =\u003e\n    val id = sqids.encodeUnsafeString(1, 2, 3)\n    println(id) \n    // 86Rf07xd4z\n    println(sqids.decode(id)) \n    // List(1, 2, 3)\n  }\n```\n\nPrevent specific words from appearing anywhere in the auto-generated IDs:\n\n(Blocked ids/words does still decode to correct numbers)\n```scala\nimport sqids.options.Blocklist\nimport sqids.Sqids\n\nval sqids = Sqids.withBlocklist(Blocklist(Set(\"86Rf07\", \"se8ojk\")))\nval id = sqids.encodeUnsafeString(1, 2, 3) \n// id: String = \"ARsz1p\"\n\nsqids.decode(id)\n// List(1, 2, 3)\nsqids.decode(\"86Rf07\")\n// List(1, 2, 3)\nsqids.decode(\"se8ojk\")\n// List(1, 2, 3)\n\n```\n\n## 📝 License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-scala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsqids%2Fsqids-scala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsqids%2Fsqids-scala/lists"}