{"id":24796502,"url":"https://github.com/fehnomenal/hashids-spring-boot-starter","last_synced_at":"2025-08-09T12:35:29.393Z","repository":{"id":57743080,"uuid":"266992021","full_name":"fehnomenal/hashids-spring-boot-starter","owner":"fehnomenal","description":"Easily use Hashids with Spring Boot","archived":false,"fork":false,"pushed_at":"2023-03-31T11:57:33.000Z","size":82,"stargazers_count":15,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-10T22:01:51.946Z","etag":null,"topics":["hashids","jackson","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/fehnomenal.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,"zenodo":null}},"created_at":"2020-05-26T08:50:41.000Z","updated_at":"2025-05-07T00:24:44.000Z","dependencies_parsed_at":"2025-05-10T22:00:57.981Z","dependency_job_id":"99655ec8-be9b-4ce3-a7d6-cd4ad018e708","html_url":"https://github.com/fehnomenal/hashids-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fehnomenal/hashids-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehnomenal%2Fhashids-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehnomenal%2Fhashids-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehnomenal%2Fhashids-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehnomenal%2Fhashids-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fehnomenal","download_url":"https://codeload.github.com/fehnomenal/hashids-spring-boot-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fehnomenal%2Fhashids-spring-boot-starter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269578337,"owners_count":24441355,"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-08-09T02:00:10.424Z","response_time":111,"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":["hashids","jackson","spring-boot"],"created_at":"2025-01-30T00:38:44.402Z","updated_at":"2025-08-09T12:35:29.345Z","avatar_url":"https://github.com/fehnomenal.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hashids Spring Boot Starter\n\n[![Maven Central](https://img.shields.io/maven-central/v/systems.fehn/hashids-spring-boot-starter)](https://search.maven.org/artifact/systems.fehn/hashids-spring-boot-starter)\n\n- Provides a bean for Hashids from https://github.com/10cella/hashids-java\n- Allows customizing the properties of Hashids via Spring properties (`hashids.salt`, `hashids.min-hash-length` and `hashids.alphabet`)\n- Automatically decodes Spring request parameters\n- Automatically encodes/decodes values with jackson\n\n\n\n## Usage\n\n### Add the dependency\n\nThis library is available Maven Central.\nIf using Maven, add the following dependency to your `pom.xml`:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003esystems.fehn\u003c/groupId\u003e\n  \u003cartifactId\u003ehashids-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e${version}\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf using Gradle, add the following dependency:\n```groovy\nimplementation 'systems.fehn:hashids-spring-boot-starter:${version}'\n```\n\nIf using Gradle with the Kotlin DSL, add the following dependency:\n```kotlin\nimplementation(\"systems.fehn:hashids-spring-boot-starter:${version}\")\n```\n\n\n\n## Configuration\n\nCustomize how the hashids object is created by using the Spring properties:\n- `hashids.salt`\n- `hashids.min-hash-length`\n- `hashids.alphabet`\n\n\n\n## `Hashids` bean\n\n`@Autowire` an `org.hashids.Hashids` bean into your Spring components.\nE.g.:\n\n```java\n@Controller\npublic class UserController {\n    private final Hashids hashids;\n\n    public UserController(final Hashids hashids) {\n        this.hashids = hashids;\n    }\n}\n```\n\n\n\n## `@Hashids` annotation\n\n### Model fields\n\nAlternatively, you can annotate fields in your models with `@systems.fehn.boot.starter.hashids.Hashids`:\n\n```java\npublic class UserModel {\n    @Hashids\n    public long id;\n    public String name;\n}\n```\n\nNow the user's id will be automatically encoded and decoded with the `Hashids` bean.\n\n`@Hashids` can be applied to types `int`, `Integer`, `long`, `Long` and arrays of these types.\n\nYou can customize all settings for each annotation (they are optional and default to the value of the corresponding property):\n\n```java\npublic class UserModel {\n    @Hashids(salt = \"abc\", minHashLength = 8, alphabet = \"abcdefghijklmnopqrstuvwxyz\")\n    public long id;\n    public String name;\n}\n```\n\n\n\n### Controller parameters\n\nRequest parameters of controller methods can be annotated in the same fashion.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffehnomenal%2Fhashids-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffehnomenal%2Fhashids-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffehnomenal%2Fhashids-spring-boot-starter/lists"}