PHPackages                             semperton/multibase - 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. semperton/multibase

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

semperton/multibase
===================

Base transcoder with multibyte character alphabet support.

2.1.0(3y ago)012MITPHPPHP &gt;=7.4

Since Jul 31Pushed 3y agoCompare

[ Source](https://github.com/semperton/multibase)[ Packagist](https://packagist.org/packages/semperton/multibase)[ RSS](/packages/semperton-multibase/feed)WikiDiscussions main Synced 4w ago

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

[![Semperton](https://raw.githubusercontent.com/semperton/.github/main/readme-logo.svg)](https://github.com/semperton)Semperton Multibase
===================

[](#semperton-multibase)

Base transcoder with multibyte character alphabet support.

---

Installation
------------

[](#installation)

Just use Composer:

```
composer require semperton/multibase

```

Multibase requires PHP 7.4+ and the mbstring extension

> Tip: Install the GMP extension for faster base conversion up to base 62

Package
-------

[](#package)

Included base transcoders:

- Base58
- Base62
- Base85 RFC 1924

Usage
-----

[](#usage)

Multibase transcoders are able to convert any arbitrary data. Use them as URL / MD5 shorteners, password generators, Base64 alternatives...

```
use Semperton\Multibase\Base62;
use Semperton\Multibase\Base85;

// basic usage
$base62 = new Base62();
$base62->encode('Hello World'); // 73XpUgyMwkGr29M
$base62->decode('73XpUgyMwkGr29M'); // Hello World

// shorten md5 hash
$hash = md5('Hello World'); // b10a8db164e0754105b7a99be72e3fe5

$short = $base62->encode(hex2bin($hash)); // 5O4SoozqXEOwlYtvkC5zkr
$short = $base62->encode(md5('Hello World', true)); // same as above

$decoded = $base62->decode($short);
$hash === bin2hex($decoded); // true

// password generation
$bytes = openssl_random_pseudo_bytes(16);
$password = (new Base85())->encode($bytes); // e.g. Ncg>RWSYO+2t@~G8PO0J
```

Custom transcoders
------------------

[](#custom-transcoders)

You can create custom transcoders with your own alphabets (multibyte support). Just for fun, how about an emoji transcoder?

```
use Semperton\Multibase\Transcoder\BaseTranscoder;

$emojiTranscoder = new BaseTranscoder(
	'🧳🌂☂️🧵🪡🪢🧶👓🕶🥽🥼🦺👔👕👖🧣🧤🧥🧦👗👘🥻🩴🩱🩲' .
	'🩳👙👚👛👜👝🎒👞👟🥾🥿👠👡🩰👢👑👒🎩🎓🧢⛑🪖💄💍💼'
);

$encoded = $emojiTranscoder->encode('Hello World'); // ☂🪢👟🩴🩰🥻👚👙🧢🩲🧥🥽🎩👙👝🎒
$emojiTranscoder->decode($encoded); // Hello World
```

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~34 days

Total

4

Last Release

1274d ago

Major Versions

1.0.1 → 2.0.02022-11-10

### Community

Maintainers

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

---

Top Contributors

[![jrabausch](https://avatars.githubusercontent.com/u/38224080?v=4)](https://github.com/jrabausch "jrabausch (38 commits)")

---

Tags

base-converterbase58base62base85decoderencoderpassword-generatorphpsempertontranscoderurl-shortener

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/semperton-multibase/health.svg)

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

###  Alternatives

[slushie/laravel-assetic

Assetic support for Laravel 4

3717.0k](/packages/slushie-laravel-assetic)[welp/ical-bundle

Symfony Bundle to manage .ics iCal file (creating and eventually reading)

10114.3k](/packages/welp-ical-bundle)

PHPackages © 2026

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