PHPackages                             kvz/youtube-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. kvz/youtube-id

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

kvz/youtube-id
==============

Translates a number to a short alphanumeric version

0.0.1(7y ago)52774[1 PRs](https://github.com/kvz/youtube-id/pulls)MITPHPPHP ^7.0

Since Apr 3Pushed 3y agoCompare

[ Source](https://github.com/kvz/youtube-id)[ Packagist](https://packagist.org/packages/kvz/youtube-id)[ Docs](https://github.com/kvz/youtube-id)[ RSS](/packages/kvz-youtube-id/feed)WikiDiscussions master Synced today

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

YouTube like ID
===============

[](#youtube-like-id)

Translates a number to a short alphanumeric version
---------------------------------------------------

[](#translatesanumbertoashortalphanumericversion)

### Requires:

[](#requires)

- PHP 7.0+

### Installation:

[](#installation)

```
composer require kvz/youtube-id
```

### Usage:

[](#usage)

> **Don't forget to:**
>
> `use Kvz\YoutubeId\Converter;`

Convert any number up to 9007199254740992 to a shorter version in letters e.g.:

```
Converter::toAlphanumeric(2188847690240); // C7nXQpS
```

Convert back from short version in letters to numbers:

```
Converter::toNumeric('C7nXQpS'); // 2188847690240
```

If you want the alphaID to be at least 3 letter long, use the `$padUp` argument.

> In most cases this is better than totally random ID generators because this can easily avoid duplicate ID's.
>
> For example if you correlate the alpha ID to an auto incrementing ID in your database, you're done.

```
Converter::toAlphanumeric(2188847690240, 3); // C7nXQpS
Converter::toNumeric('C7nXQpS', 3); // 2188847686396
```

Although this function's purpose is to just make the ID short - and not so much secure, with third argument `secureKey` you can optionally supply a password to make it harder to calculate the corresponding numeric ID.

```
Converter::toAlphanumeric(1327301435881, 3, 'Shfu388291ssD'); // C7nXQpS
Converter::toNumeric('C7nXQpS', 3, 'Shfu388291ssD'); // 1327301435881
```

And, for final, you can easy transform alphanumeric result:

```
Converter::toAlphanumeric(2188847690240, 0, null, Converter::TRANSFORM_UPPERCASE); // C7NXQPS
Converter::toAlphanumeric(2188847690240, 0, null, Converter::TRANSFORM_LOWERCASE); // c7nxqps
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

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

2596d ago

### Community

Maintainers

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

---

Top Contributors

[![kvz](https://avatars.githubusercontent.com/u/26752?v=4)](https://github.com/kvz "kvz (2 commits)")[![wow-apps](https://avatars.githubusercontent.com/u/2779949?v=4)](https://github.com/wow-apps "wow-apps (2 commits)")

---

Tags

generatoridid-generatoryoutube id

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/kvz-youtube-id/health.svg)

```
[![Health](https://phpackages.com/badges/kvz-youtube-id/health.svg)](https://phpackages.com/packages/kvz-youtube-id)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[ada-u/chocoflake

64bit time based id generator

14117.3k](/packages/ada-u-chocoflake)

PHPackages © 2026

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