PHPackages                             nabeghe/alphanum - 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. nabeghe/alphanum

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

nabeghe/alphanum
================

Converting decimal numbers to alphanums, which include uppercase &amp; lowercase letters as well as the underscore character, &amp; vice versa.

v1.0.0(10mo ago)33MITPHPPHP &gt;=7.0

Since Oct 22Pushed 10mo ago1 watchersCompare

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

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

Alphanum for PHP.
=================

[](#alphanum-for-php)

> Converting decimal numbers to alphanums, which include uppercase &amp; lowercase letters as well as the underscore character, &amp; vice versa.

**Notice:** It's useful for shortening links by converting post numbers to alphanumeric characters.

---

🫡 Usage
-------

[](#-usage)

### 🚀 Installation

[](#-installation)

You can install the package via composer:

```
composer require nabeghe/alphanum
```

---

#### Example:

[](#example)

```
use Nabeghe\Alphanum\Alphanum;

echo "[[ To Alphanum ]]\n";
echo '0 => '.Alphanum::generate(0)."\n"; // 0
echo '1 => '.Alphanum::generate(1)."\n"; // 1
echo '10 => '.Alphanum::generate(10)."\n"; // A
echo '11 => '.Alphanum::generate(11)."\n"; // B
echo '12 => '.Alphanum::generate(12)."\n"; // C
echo '13 => '.Alphanum::generate(13)."\n"; // D
echo '14 => '.Alphanum::generate(14)."\n"; // E
echo '100 => '.Alphanum::generate(100)."\n"; // 1f
echo '1000 => '.Alphanum::generate(1000)."\n"; // Gf
echo '1403 => '.Alphanum::generate(1403)."\n"; // NN
echo '2024 => '.Alphanum::generate(2024)."\n"; // Yj
echo '1000000 => '.Alphanum::generate(1000000)."\n"; // 4clf
echo '1000000000 => '.Alphanum::generate(1000000000)."\n"; // 1H9clf
echo 'PHP_INT_MAX => '.Alphanum::generate(PHP_INT_MAX)."\n"; // FFDZXWuKFV7
echo "\n";

echo "[[ To Decimal ]]\n";
echo '0 => '.Alphanum::toDecimal('0')."\n"; // 0
echo '1 => '.Alphanum::toDecimal('1')."\n"; // 1
echo 'A => '.Alphanum::toDecimal('A')."\n"; // 10
echo 'B => '.Alphanum::toDecimal('B')."\n"; // 11
echo 'C => '.Alphanum::toDecimal('C')."\n"; // 12
echo 'D => '.Alphanum::toDecimal('D')."\n"; // 13
echo 'E => '.Alphanum::toDecimal('E')."\n"; // 14
echo '1f => '.Alphanum::toDecimal('1f')."\n"; // 100
echo 'Gf => '.Alphanum::toDecimal('Gf')."\n"; // 1000
echo 'NN => '.Alphanum::toDecimal('NN')."\n"; // 1403
echo 'Yj => '.Alphanum::toDecimal('Yj')."\n"; // 2024
echo '4clf => '.Alphanum::toDecimal('4clf')."\n"; // 1000000
echo '1H9clf => '.Alphanum::toDecimal('1H9clf')."\n"; // 1000000000
echo 'FFDZXWuKFV7 => '.Alphanum::toDecimal('FFDZXWuKFV7')."\n"; // PHP_INT_MAX
echo "\n";
```

---

📖 License
---------

[](#-license)

Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance54

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

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

Total

2

Last Release

320d ago

Major Versions

0.1.0 → v1.0.02025-07-02

### Community

Maintainers

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

---

Top Contributors

[![nabeghe](https://avatars.githubusercontent.com/u/12207627?v=4)](https://github.com/nabeghe "nabeghe (2 commits)")

---

Tags

alphanumericalphanumeric-stringsphpphp-helperphp-helpersphp-libphp-librariesphp-libraryphp-numberphp-numbers-to-lettersphp-short-urlphp-supportsexagesimalshortlinkhelperstringlibrarydecimalsupportnumbersnumerichexadecimalalphanumalphabeticsexagesimal

### Embed Badge

![Health badge](/badges/nabeghe-alphanum/health.svg)

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

###  Alternatives

[rtlopez/decimal

An object oriented immutable arbitrary-precision arithmetic library for PHP

27262.8k2](/packages/rtlopez-decimal)[clausnz/php-helpers

A Collection of useful php helper functions.

388.7k](/packages/clausnz-php-helpers)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2516.7k](/packages/iteks-laravel-enum)[danog/phpstruct

PHP implementation of python's struct module.

1110.1k](/packages/danog-phpstruct)

PHPackages © 2026

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