PHPackages                             fzaffa/baseconverter - 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. fzaffa/baseconverter

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

fzaffa/baseconverter
====================

Converts base 10 numbers to any set of characters provided, for example an \[a-zA-Z\] range.

27.2k↓44.1%PHP

Since Aug 27Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

\#BaseConverter The purpose of this library is to convert decimal numbers to higher bases represented only by alphabet characters to render them easier to remember and easier on the eyes for permalinks and similar applications.

\##Installation

```
    $ composer require fzaffa/baseconverter
```

```
    {
        "require": {
            "fzaffa/baseconverter": "dev-master"
        }
    }
```

\##Usage

```
    use Fzaffa\BaseConverter\BaseConverter;
    use Fzaffa\BaseConverter\ConverterRangeTypes;

    require "vendor/autoload.php"

    $converter = new BaseConverter(ConverterRangeTypes::ALPHA_ULCASE);

    echo $converter->convert(34523) //Outputs: mNV

    echo $converter->convert("mNV") //Outputs: 34523
```

The `convert()` method will automatically get the type of the argument, if it is numeric (also a string containing only numbers work) it will convert to a string, if it's a string it will convert to decimal. To force one or the other use `convertFromStringToInt` or `convertFromIntToString`.

The provided ranges are:

- `ConverterRangeTypes::ALPHA_LCASE` for \[a-z\]
- `ConverterRangeTypes::ALPHA_UCASE` for \[A-Z\]
- `ConverterRangeTypes::ALPHA_ULCASE` for \[a-zA-Z\]

You can pass in any array of chars that will be used in lieu of their decimal representation (eg. 12 will be the 12th element of the array).

\##Notes Will add tests soon.

\##Todo

- Handle cases where the target base is less than 10
- Write unit tests

\##License MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

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

---

Top Contributors

[![smuuf](https://avatars.githubusercontent.com/u/6860713?v=4)](https://github.com/smuuf "smuuf (1 commits)")

### Embed Badge

![Health badge](/badges/fzaffa-baseconverter/health.svg)

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

###  Alternatives

[baidu/aip-sdk

baidu pulic ai php sdk

119104.9k6](/packages/baidu-aip-sdk)[thestringler-laravel/manipulator

A Laravel package for The Stringler

315.0k](/packages/thestringler-laravel-manipulator)

PHPackages © 2026

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