{"id":19308067,"url":"https://github.com/pgssoft/hashid","last_synced_at":"2025-04-22T13:31:49.874Z","repository":{"id":46284163,"uuid":"125339785","full_name":"PGSSoft/HashId","owner":"PGSSoft","description":"Replace your integer url params in Symfony applications and hide under unpredictable strings.","archived":false,"fork":false,"pushed_at":"2023-10-17T21:11:12.000Z","size":2216,"stargazers_count":12,"open_issues_count":8,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T00:11:12.566Z","etag":null,"topics":["hashid","obfuscator","param-converter","pgs","php","routing","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/PGSSoft.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}},"created_at":"2018-03-15T09:02:41.000Z","updated_at":"2023-11-08T11:03:26.000Z","dependencies_parsed_at":"2022-09-14T17:04:24.483Z","dependency_job_id":null,"html_url":"https://github.com/PGSSoft/HashId","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSSoft%2FHashId","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSSoft%2FHashId/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSSoft%2FHashId/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSSoft%2FHashId/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PGSSoft","download_url":"https://codeload.github.com/PGSSoft/HashId/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250248700,"owners_count":21399321,"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":["hashid","obfuscator","param-converter","pgs","php","routing","symfony","symfony-bundle"],"created_at":"2024-11-10T00:13:35.119Z","updated_at":"2025-04-22T13:31:49.401Z","avatar_url":"https://github.com/PGSSoft.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![PGS Software](https://www.pgs-soft.com/pgssoft-logo.png)](https://www.pgs-soft.com) / HashId\r\n\r\n![PHP from Packagist](https://img.shields.io/packagist/php-v/symfony/symfony.svg)\r\n[![Build Status](https://travis-ci.org/PGSSoft/HashId.svg?branch=3.0)](https://travis-ci.org/PGSSoft/HashId)\r\n[![Code Coverage](https://scrutinizer-ci.com/g/PGSSoft/HashId/badges/coverage.png?b=dev-master)](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=dev-master)\r\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PGSSoft/HashId/badges/quality-score.png?b=dev-master)](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=dev-master)\r\n\r\nSymfony bundle for encoding integer route parameters and decoding request parameters with \u003chttp://www.hashids.org/\u003e\r\n***\r\nPlease use this version with Symfony \u0026ge;5.0\r\n***\r\nReplace predictable integer url parameters in easy way:\r\n  * `/hash-id/demo/decode/216/30` =\u003e `/hash-id/demo/decode/X46dBNxd79/30`\r\n  * `/order/315` =\u003e `/order/4w9aA11avM`  \r\n\r\nPros:\r\n  * no need to use extra filters - use `{{ url('route_name', {'id': 1}) }}` in twig template or `$this-\u003egenerateUrl('route_name', ['id' =\u003e 1]);` in controller or service\r\n  * [Doctrine Converter](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html#doctrine-converter) compatible\r\n\r\n## Instalation\r\n```bash\r\ncomposer require pgs-soft/hashid-bundle \r\n```\r\n\r\n## Hashids configuration\r\n```yaml\r\n# config/packages/pgs_hash_id.yaml\r\n\r\npgs_hash_id:\r\n    converter:\r\n        hashids:\r\n            salt: 'my super salt'\r\n            min_hash_length: 20\r\n            alphabet: 'qwertyasdzxc098765-'\r\n```\r\n\r\n## Controller configuration\r\n```php\r\nuse Pgs\\HashIdBundle\\Annotation\\Hash;\r\n\r\nclass UserController extends Controller\r\n{\r\n    /**\r\n     * @Hash(\"id\")\r\n     */\r\n    public function edit(int $id)\r\n    {\r\n    //...\r\n    }\r\n    \r\n    /**\r\n     * Process multiple parameters - 'oneMore' will not be processed\r\n     * @Route(name=\"test\", path=\"/test/{id}/{other}/{oneMore}\")\r\n     * @Hash({\"id\",\"other\"})\r\n     */\r\n    public function test(int $id, int $other, int $oneMore)\r\n    {\r\n    //...\r\n    }\r\n}\r\n```\r\n\r\nYou can also check our [DemoController](src/Controller/DemoController.php).\r\n\r\n## Contributing\r\n\r\nBug reports and pull requests are welcome on GitHub at [https://github.com/PGSSoft/HashId](https://github.com/PGSSoft/HashId).\r\n\r\n\r\n## About\r\n\r\nThe project maintained by [software development agency](https://www.pgs-soft.com/) [PGS Software](https://www.pgs-soft.com/).\r\nSee our other [open-source projects](https://github.com/PGSSoft) or [contact us](https://www.pgs-soft.com/contact-us/) to develop your product.\r\n\r\n\r\n## Follow us\r\n\r\n[![Twitter URL](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=https://github.com/PGSSoft/InAppPurchaseButton)\r\n[![Twitter Follow](https://img.shields.io/twitter/follow/pgssoftware.svg?style=social\u0026label=Follow)](https://twitter.com/pgssoftware)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgssoft%2Fhashid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgssoft%2Fhashid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgssoft%2Fhashid/lists"}