PHPackages                             as3/short-mongo-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. as3/short-mongo-id

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

as3/short-mongo-id
==================

Generates a short string identifier from a Mongo object id value.

v1.0(9y ago)523.0k1[1 issues](https://github.com/as3io/short-mongo-id/issues)MITPHPPHP &gt;=5.4

Since Jul 13Pushed 9y ago3 watchersCompare

[ Source](https://github.com/as3io/short-mongo-id)[ Packagist](https://packagist.org/packages/as3/short-mongo-id)[ RSS](/packages/as3-short-mongo-id/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Short Mongo ID for PHP
======================

[](#short-mongo-id-for-php)

Generates a short string identifier from a MongoId value.

This repository is a PHP port of the npm/javascript library created by treygriffith. The usage and preamble of the following documentation is taken from that repository and modified for use with PHP. The original repo can be found here:

========

Id's are generated from the timestamp and counter of the MongoDB Id, with some slight variation. They should be reasonably unique.

This is, unfortunately, a one-way function. It will reliably produce the same short id for the same MongoDB Id, but the operation can't be reversed (it is missing information about the machine id, process id, and most of the counter).

Install
-------

[](#install)

Use Composer:

```
$ composer require as3/short-mongo-id
```

Usage
-----

[](#usage)

Pass a PHP MongoId object (or a string that can be converted to one) and it will return a reasonably unique short id made of `[-_a-zA-Z0-9]`.

```
use As3\ShortMongoId\Shortener;

$shortener = new Shortener();
$shortId   = $shortener->shorten('507f191e810c19729de860ea'); // returns "iTxuMF"
```

License
-------

[](#license)

MIT (see [License](LICENSE))

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

3643d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/1edba31ec2714e8cfac7a4c1232c56cf40a26d154876c0d9b42d984944056758?d=identicon)[solocommand](/maintainers/solocommand)

### Embed Badge

![Health badge](/badges/as3-short-mongo-id/health.svg)

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

###  Alternatives

[verbb/comments

Add comments to your site.

13753.9k](/packages/verbb-comments)[friends-of-hyva/magento2-preload-images

Preload images above the fold to improve performance metrics.

2318.4k](/packages/friends-of-hyva-magento2-preload-images)[koalafacade/filament-navigation-holder

A holder package for filament navigation scroll position

1620.2k](/packages/koalafacade-filament-navigation-holder)

PHPackages © 2026

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