PHPackages                             little-superman/hyperf-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. little-superman/hyperf-hashids

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

little-superman/hyperf-hashids
==============================

v0.0.1(5y ago)112MITPHPPHP &gt;=7.4

Since Mar 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/myadream/hyperf-hashids)[ Packagist](https://packagist.org/packages/little-superman/hyperf-hashids)[ RSS](/packages/little-superman-hyperf-hashids/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

[![hashids](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png)](https://cloud.githubusercontent.com/assets/499192/11159205/faa429ae-8a5d-11e5-8c5d-c60a89290c5e.png)

Hyperf Hashids
==============

[](#hyperf-hashids)

> A [Hashids](http://hashids.org) bridge for Hyperf.

```
// Encode integers.
Hashids::encode(4815162342);

// Decode strings.
Hashids::decode('1LLb3b4ck');

// Dependency injection example.
$hashidsManager->encode(911);
```

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

[](#installation)

Require this package, with [Composer](https://getcomposer.org/), in the root directory of your project.

```
$ composer require "little-superman/hyperf-hashids:dev-main"
```

Configuration
-------------

[](#configuration)

Hyperf Hashids requires connection configuration. To get started, you'll need to publish all vendor assets:

```
$ php bin/hyperf.php vendor:publish hyperf/hashids
```

This will create a `config/hashids.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

#### Default Connection Name

[](#default-connection-name)

This option `default` is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `main`.

#### Hashids Connections

[](#hashids-connections)

This option `connections` is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like.

Usage
-----

[](#usage)

Here you can see an example of you may use this package. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
// You can alias this in config/app.php.
use LittleSuperman\HyperfHashids\Hashids;

// We're done here - how easy was that, it just works!
Hashids::encode(4815162342);

// This example is simple and there are far more methods available.
Hashids::decode('doyouthinkthatsairyourebreathingnow');
```

The manager will behave like it is a `Hashids\Hashids` class. If you want to call specific connections, you can do that with the connection method:

```
use LittleSuperman\HyperfHashids\Hashids;

// Writing this...
Hashids::connection('main')->encode($id);

// ...is identical to writing this
Hashids::encode($id);

// and is also identical to writing this.
Hashids::connection()->encode($id);

// This is because the main connection is configured to be the default.
Hashids::getDefaultConnection(); // This will return main.

// We can change the default connection.
Hashids::setDefaultConnection('alternative'); // The default is now alternative.
```

If you prefer to use dependency injection over facades, then you can inject the manager:

```
use LittleSuperman\HyperfHashids\Contract\HashidsInterface;

class Foo
{
    protected $hashids;

    public function __construct(HashidsInterface $hashids)
    {
        $this->hashids = $hashids;
    }

    public function bar($id)
    {
        $this->hashids->encode($id);
    }
}

App::make('Foo')->bar();
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1885d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d17508a4386e617fbb4d02874d11b6ca22e6a9404995d788c83b34d1469bc511?d=identicon)[myadream](/maintainers/myadream)

---

Top Contributors

[![myadream](https://avatars.githubusercontent.com/u/40756102?v=4)](https://github.com/myadream "myadream (2 commits)")

---

Tags

phphashidshyperf

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/little-superman-hyperf-hashids/health.svg)

```
[![Health](https://phpackages.com/badges/little-superman-hyperf-hashids/health.svg)](https://phpackages.com/packages/little-superman-hyperf-hashids)
```

###  Alternatives

[hyperf/watcher

Hot reload watcher for Hyperf

17846.7k27](/packages/hyperf-watcher)

PHPackages © 2026

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