PHPackages                             drksh/slugger - 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. drksh/slugger

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

drksh/slugger
=============

The slugging library used by Darkshare to create incremental slugs.

v2.0(5y ago)314[1 issues](https://github.com/drksh/slugger/issues)MITPHPPHP ^7.2.5

Since Nov 20Pushed 5y ago2 watchersCompare

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

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

A solid slugger
===============

[](#a-solid-slugger)

I've been looking for slugging libraries which are able to create incremental slugs, I couldn't find anything that satisfied my needs, therefore I had to have a go at it.

Incremental slugs
-----------------

[](#incremental-slugs)

These are best known for their sort nature in URL-shorteners. Let me give you an example of how they can work

Let's say you have your own little URL-shortener, and each of the user submitted URL's have an id. Since base-10 limits you very quickly, character-wise, you might want to show id `81259151` as `fUcod`.

Usage
-----

[](#usage)

```
// Transform ID's to slugs.
Darkshare\Slugger::encode(1); // a
Darkshare\Slugger::encode(81259151); // fUcod

// Transform slugs to IDs.
Darkshare\Slugger::decode('a'); // 1
Darkshare\Slugger::decode('fUcod'); // 81259151
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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

Every ~446 days

Total

4

Last Release

2124d ago

Major Versions

v0.1.0 → v1.02017-08-30

v1.1.0 → v2.02020-07-21

PHP version history (2 changes)v0.1.0PHP ^7.0|^7.1

v1.1.0PHP ^7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f02eab227c36f5712aa61070faddfcf431a956b246e8e381dffc5aa588f2424?d=identicon)[jstoone](/maintainers/jstoone)

---

Top Contributors

[![jstoone](https://avatars.githubusercontent.com/u/1711456?v=4)](https://github.com/jstoone "jstoone (25 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/drksh-slugger/health.svg)

```
[![Health](https://phpackages.com/badges/drksh-slugger/health.svg)](https://phpackages.com/packages/drksh-slugger)
```

###  Alternatives

[prooph/standard-projections

Standard Projections for Prooph EventStore

1526.7k](/packages/prooph-standard-projections)[it-quasar/atol-online

Библиотека для работы с АТОЛ Онлайн

119.4k](/packages/it-quasar-atol-online)

PHPackages © 2026

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