PHPackages                             ngubin/key62 - 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. ngubin/key62

Abandoned → [ngubin/key-n](/?search=ngubin%2Fkey-n)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

ngubin/key62
============

Generating a unique short key from the number.

v1.0.1(9y ago)04.5kMITPHPPHP &gt;=5.4.45

Since Apr 24Pushed 5y agoCompare

[ Source](https://github.com/ngubin/key62)[ Packagist](https://packagist.org/packages/ngubin/key62)[ Docs](https://github.com/ngubin/key62)[ RSS](/packages/ngubin-key62/feed)WikiDiscussions master Synced 3w ago

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

The repository is **abandoned**. Use  instead!

---

Key62
=====

[](#key62)

Generating a unique short key from the number.

A simple class for converting a number into a string key and back. You can use to shorten long numbers to unique keys.

[![Latest Version](https://camo.githubusercontent.com/0e9eb3f761d92c4c5ca214ea0c0f66c5eb5bb81634e1bcde06b854ed605c57b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6e677562696e2f6b657936322e7376673f7374796c653d666c61742d737175617265)](https://github.com/ngubin/key62/releases)[![Total Downloads](https://camo.githubusercontent.com/accc746c5d675c0f89fe179de6e6e9fe806a3c58f7e5c388c61513f2640e51f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e677562696e2f6b657936322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ngubin/key62)

Example Usage
-------------

[](#example-usage)

#### Creating a key from a number:

[](#creating-a-key-from-a-number)

You can only encode an integer greater than or equal to zero.

```
use Key62\Key62;

$key62 = new Key62();
$key = $key62->encode(100000);
```

#### Set your own character set to create keys and the minimum number of characters in the key:

[](#set-your-own-character-set-to-create-keys-and-the-minimum-number-of-characters-in-the-key)

If you change the minimum length of the key when encoding, then do not forget to set it with the reverse decryption of the key.

```
use Key62\Key62;

$characters = 'wWpJbH8nIDed1Evq5OcToF2ZuXsayz7RrtP490ixSKC3GM6gYkNVhBUQmLlfAj';
$length = 4;

$key62 = new Key62($characters, $length);
$key = $key62->encode(100000);
```

#### Getting the number from the key:

[](#getting-the-number-from-the-key)

You can decode the key if all of its characters are in the class set.

```
use Key62\Key62;

$key62 = new Key62();
$number = $key62->decode('Gh1a');
```

License
-------

[](#license)

This project is released under the MIT License.

© 2017 Nik Gubin, All rights reserved.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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 ~17 days

Total

2

Last Release

3336d ago

### Community

Maintainers

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

---

Top Contributors

[![ngubin](https://avatars.githubusercontent.com/u/19705675?v=4)](https://github.com/ngubin "ngubin (5 commits)")

### Embed Badge

![Health badge](/badges/ngubin-key62/health.svg)

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

###  Alternatives

[dapr/php-sdk

Dapr Implementation in PHP

7497.0k6](/packages/dapr-php-sdk)

PHPackages © 2026

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