PHPackages                             gerlovsky/php-short-id - 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. gerlovsky/php-short-id

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

gerlovsky/php-short-id
======================

Short ID generator. The library help you generate short id like youtube, vimeo, bit.ly, etc.

1.0(7y ago)222MITPHPPHP &gt;=5.4

Since May 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/gerlovsky/php-short-id)[ Packagist](https://packagist.org/packages/gerlovsky/php-short-id)[ Docs](https://github.com/Gerlovsky/php-short-id)[ RSS](/packages/gerlovsky-php-short-id/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

PHP Short ID creator
====================

[](#php-short-id-creator)

[![Build Status](https://camo.githubusercontent.com/df54373099ff3228dde4549aa8cf57989ea45d766c5ac8fe7d5cd9754e3a4412/68747470733a2f2f7472617669732d63692e6f72672f6765726c6f76736b792f7068702d73686f72742d69642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gerlovsky/php-short-id)

The library help you generate short id like youtube, vimeo, bit.ly, etc. Short generation (creation) based on numerical ID.

Simple scenarios of using
-------------------------

[](#simple-scenarios-of-using)

```
require('vendor/autoload.php');

$shortId = new \Gerlovsky\ShortId\ShortId();
```

### Creating short ID for a record from in a database

[](#creating-short-id-for-a-record-from-in-a-database)

1. when an app created a record in an your database with ID 20956
2. $shortId-&gt;encode(20956) encodes it to 'bfrE'
3. you updated the record for ID 20956 and set short\_id of the record to 'bfrE'

```
$id = $shortId->encode(20956);     // $id will be 'bfrE'

// or with $length = 6
$id = $shortId->encode(20956, 6);  // $id will be 'baauC6'
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

2908d ago

### Community

Maintainers

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

---

Top Contributors

[![gerlovsky](https://avatars.githubusercontent.com/u/3325830?v=4)](https://github.com/gerlovsky "gerlovsky (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gerlovsky-php-short-id/health.svg)

```
[![Health](https://phpackages.com/badges/gerlovsky-php-short-id/health.svg)](https://phpackages.com/packages/gerlovsky-php-short-id)
```

###  Alternatives

[paulredmond/html-to-amp

A PHP Library to Convert HTML to AMP HTML

6826.0k](/packages/paulredmond-html-to-amp)[mageprince/module-buynow

Magento2 Buy Now Module

829.7k](/packages/mageprince-module-buynow)[netzmacht/php-leaflet

PHP leaflet definition and javascript generator

1927.2k2](/packages/netzmacht-php-leaflet)

PHPackages © 2026

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