PHPackages                             yiier/yii2-hashids - 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. yiier/yii2-hashids

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yiier/yii2-hashids
==================

Hashids for Yii2

v3.0.0(4y ago)1463MITPHPPHP ^7.4 || ^8.0

Since Aug 6Pushed 4y agoCompare

[ Source](https://github.com/yiier/yii2-hashids)[ Packagist](https://packagist.org/packages/yiier/yii2-hashids)[ RSS](/packages/yiier-yii2-hashids/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (7)Used By (0)

Yii2 for [hashids](https://github.com/vinkla/hashids)
-----------------------------------------------------

[](#yii2-for-hashids)

[![Build Status](https://camo.githubusercontent.com/e1b5f56d990201cdd2382b1f990e81d2203fd4adac4fdff48e8250befffb378c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f79696965722f796969322d686173686964732e7376673f7374796c653d666c61742d737175617265)](http://travis-ci.org/yiier/yii2-hashids)[![version](https://camo.githubusercontent.com/cdbfcf164344dd3dfabc72285bf2cace9042a116da29a0c063878a08d1488df8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79696965722f796969322d686173686964732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yiier/yii2-hashids)[![Download](https://camo.githubusercontent.com/ce3415611a4d135a66ee73b57bf57513094f6ce79c7cd81529e0d2bb7e9f907e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f79696965722f796969322d686173686964732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/yiier/yii2-hashids)[![Issues](https://camo.githubusercontent.com/398bfc303b1df5398fd54bd50e625f55ee14f8b6b609c5162800d2c123e43f16/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f79696965722f796969322d686173686964732e7376673f7374796c653d666c61742d737175617265)](https://github.com/yiier/yii2-hashids/issues)

Installation
------------

[](#installation)

Install this package via [Composer](https://getcomposer.org/):

```
$ composer require yiier/yii2-hashids

```

Usage
-----

[](#usage)

### configurate is as a component

[](#configurate-is-as-a-component)

In your `main.php` or `web.php` (dependences your yii2 project constructor):

```
[
	'hahsids' => [
		'class' => 'yiier\hashids\Hashids',
		//'salt' => 'your salt',
		//'minHashLength' => 5,
		//'alphabet' => 'abcdefghigk'
	]
]
```

Also using this like this:

```
$hashids = Yii::createObject([
	'class' => 'yiier\hashids\Hashids'
]);

$id = $hashids->encode(1, 2, 3);
$numbers = $hashids->decode($id);
var_dump($id, $numbers);
```

Test
----

[](#test)

```
$ phpunit

```

Lisence
-------

[](#lisence)

[![MIT](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 58.1% 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 ~490 days

Recently: every ~603 days

Total

6

Last Release

1477d ago

Major Versions

1.0.x-dev → 2.0.02018-02-28

2.0.0 → v3.0.02022-04-24

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

2.0.0PHP ^5.6.4 || ^7.0

v3.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c0612f70d09feb06ab5d24a31e0cc551f1ee547b42308c695e34d76181f18cf?d=identicon)[forecho](/maintainers/forecho)

---

Top Contributors

[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (18 commits)")[![forecho](https://avatars.githubusercontent.com/u/1725326?v=4)](https://github.com/forecho "forecho (11 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![f-dg](https://avatars.githubusercontent.com/u/8408092?v=4)](https://github.com/f-dg "f-dg (1 commits)")

---

Tags

encryptdecrypthashyoutubeidshashidshashidyii2biyly

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yiier-yii2-hashids/health.svg)

```
[![Health](https://phpackages.com/badges/yiier-yii2-hashids/health.svg)](https://phpackages.com/packages/yiier-yii2-hashids)
```

###  Alternatives

[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.5k48.6M276](/packages/hashids-hashids)[light/hashids

Hashids for Yii2

1120.2k](/packages/light-hashids)[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

415246.3k2](/packages/elfsundae-laravel-hashid)[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

192564.1k](/packages/cybercog-laravel-optimus)[lingxi/hashids

A Hashids bridge for Laravel

183.3k](/packages/lingxi-hashids)[delight-im/ids

Short, obfuscated and efficient IDs for PHP

289.5k1](/packages/delight-im-ids)

PHPackages © 2026

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