PHPackages                             pgs-soft/hashid-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pgs-soft/hashid-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

pgs-soft/hashid-bundle
======================

Symfony Hash Id

v3.1.0(3y ago)1310.0k4[8 issues](https://github.com/PGSSoft/HashId/issues)[4 PRs](https://github.com/PGSSoft/HashId/pulls)MITPHPPHP &gt;=7.2.5CI failing

Since Feb 11Pushed 2y ago2 watchersCompare

[ Source](https://github.com/PGSSoft/HashId)[ Packagist](https://packagist.org/packages/pgs-soft/hashid-bundle)[ RSS](/packages/pgs-soft-hashid-bundle/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (14)Versions (22)Used By (0)

[![PGS Software](https://camo.githubusercontent.com/71d1efacf76bc5b062740df1f6e7608fc53f1da961938bab93b3be11da366623/68747470733a2f2f7777772e7067732d736f66742e636f6d2f706773736f66742d6c6f676f2e706e67)](https://www.pgs-soft.com) / HashId
============================================================================================================================================================================================================================================

[](#--hashid)

[![PHP from Packagist](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)[![Build Status](https://camo.githubusercontent.com/7822eeae8416584fc2a993b762f72a58d430fe1283daf65c89a30a3480b03b9c/68747470733a2f2f7472617669732d63692e6f72672f504753536f66742f4861736849642e7376673f6272616e63683d332e30)](https://travis-ci.org/PGSSoft/HashId)[![Code Coverage](https://camo.githubusercontent.com/536754e9d9969dc3677b2e8f0a25f011a9ec03e710666b812a45a5a5f680a3df/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f504753536f66742f4861736849642f6261646765732f636f7665726167652e706e673f623d6465762d6d6173746572)](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=dev-master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4def731fd7420365af5010607a56e87285c1eb6255093879401aeb9f811842c7/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f504753536f66742f4861736849642f6261646765732f7175616c6974792d73636f72652e706e673f623d6465762d6d6173746572)](https://scrutinizer-ci.com/g/PGSSoft/HashId/?branch=dev-master)

Symfony bundle for encoding integer route parameters and decoding request parameters with

---

Please use this version with Symfony ≥5.0

---

Replace predictable integer url parameters in easy way:

- `/hash-id/demo/decode/216/30` =&gt; `/hash-id/demo/decode/X46dBNxd79/30`
- `/order/315` =&gt; `/order/4w9aA11avM`

Pros:

- no need to use extra filters - use `{{ url('route_name', {'id': 1}) }}` in twig template or `$this->generateUrl('route_name', ['id' => 1]);` in controller or service
- [Doctrine Converter](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html#doctrine-converter) compatible

Instalation
-----------

[](#instalation)

```
composer require pgs-soft/hashid-bundle
```

Hashids configuration
---------------------

[](#hashids-configuration)

```
# config/packages/pgs_hash_id.yaml

pgs_hash_id:
    converter:
        hashids:
            salt: 'my super salt'
            min_hash_length: 20
            alphabet: 'qwertyasdzxc098765-'
```

Controller configuration
------------------------

[](#controller-configuration)

```
use Pgs\HashIdBundle\Annotation\Hash;

class UserController extends Controller
{
    /**
     * @Hash("id")
     */
    public function edit(int $id)
    {
    //...
    }

    /**
     * Process multiple parameters - 'oneMore' will not be processed
     * @Route(name="test", path="/test/{id}/{other}/{oneMore}")
     * @Hash({"id","other"})
     */
    public function test(int $id, int $other, int $oneMore)
    {
    //...
    }
}
```

You can also check our [DemoController](src/Controller/DemoController.php).

Contributing
------------

[](#contributing)

Bug reports and pull requests are welcome on GitHub at .

About
-----

[](#about)

The project maintained by [software development agency](https://www.pgs-soft.com/) [PGS Software](https://www.pgs-soft.com/). See our other [open-source projects](https://github.com/PGSSoft) or [contact us](https://www.pgs-soft.com/contact-us/) to develop your product.

Follow us
---------

[](#follow-us)

[![Twitter URL](https://camo.githubusercontent.com/cb820a0ecc9645168e33b03925d7f14691262ddbaeaf66a0a91697803d0cba2d/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f687474702f736869656c64732e696f2e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/tweet?text=https://github.com/PGSSoft/InAppPurchaseButton)[![Twitter Follow](https://camo.githubusercontent.com/57521798958e2fbd8536f96ab43f0b55ef9e7d3529c7ba845ba8594694ac4304/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f706773736f6674776172652e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77)](https://twitter.com/pgssoftware)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 97.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~235 days

Total

18

Last Release

1117d ago

Major Versions

1.0.1 → v2.0.12020-03-01

v2.0.1 → v3.0.12020-03-01

v1.0.2 → v3.0.32020-05-26

1.0.x-dev → v3.0.42020-09-28

v2.0.4 → 3.0.x-dev2023-04-27

PHP version history (3 changes)v1.0.0PHP ^7.1.3

v3.0.0PHP ^7.2.5

3.0.x-devPHP &gt;=7.2.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6838531?v=4)[Karol Joński](/maintainers/kjonski)[@kjonski](https://github.com/kjonski)

![](https://www.gravatar.com/avatar/87076a3bbf2cf766d453775096c805c2efef5e0359c1c2bd4c0ebf8f54fc0c71?d=identicon)[kwojtas6](/maintainers/kwojtas6)

---

Top Contributors

[![kjonski](https://avatars.githubusercontent.com/u/6838531?v=4)](https://github.com/kjonski "kjonski (128 commits)")[![dominikhajduk](https://avatars.githubusercontent.com/u/11769575?v=4)](https://github.com/dominikhajduk "dominikhajduk (3 commits)")

---

Tags

hashidobfuscatorparam-converterpgsphproutingsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pgs-soft-hashid-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/pgs-soft-hashid-bundle/health.svg)](https://phpackages.com/packages/pgs-soft-hashid-bundle)
```

###  Alternatives

[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
