PHPackages                             mpyw/base-utf8 - 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. mpyw/base-utf8

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

mpyw/base-utf8
==============

BaseXX encoder/decoder those support any valid UTF-8 sequences.

v2.0.0(4y ago)440MITPHPPHP &gt;=5.3.2

Since Aug 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mpyw/BaseUTF8)[ Packagist](https://packagist.org/packages/mpyw/base-utf8)[ RSS](/packages/mpyw-base-utf8/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

BaseUTF8
========

[](#baseutf8)

BaseXX encoder/decoder which support any valid UTF-8 sequences.

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

[](#installation)

```
composer require mpyw/base-utf8

```

Features
--------

[](#features)

Pass your character set as the first argument for the constructor.
Default value is `ABCD...WXYZabcd...wxyz0123456789+/` (Base64).

- It must be either array or string.
- The number of elements must be a power of two. (2, 4, 8, 16, 32, 64, ...)
- Any paddings such as `=` are not appended.
- Control characters `\x00-\x20` are ignored.

Example
-------

[](#example)

```
require __DIR__ . '/vendor/autoload.php';
use Mpyw\BaseUTF8\Coder;

$coder = new Coder; // Base64
echo $coder->encode('foobar') . PHP_EOL; // Zm9vYmFy
echo $coder->decode('Zm9vYmFy') . PHP_EOL; // foobar
echo $coder->decode("Z  m  \n9v  Y\tmFy") . PHP_EOL; // foobar

$coder = new Coder('ABCDabcd'); // Base8
echo $coder->encode('foobar') . PHP_EOL; // DBacdbbdDAacAbcC
echo $coder->decode('DBacdbbdDAacAbcC') . PHP_EOL; // foobar

$coder = new Coder('ンアッーイキソ！'); // UTF-8 Base8
echo $coder->encode('田所浩二') . PHP_EOL;
echo $coder->decode('！ア！アッッソン！アキンイソンン！アキーッソキア！アアーキッアイ') . PHP_EOL;
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

1789d ago

Major Versions

v1.0.0 → v2.0.02021-06-24

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v2.0.0PHP &gt;=5.3.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1351893?v=4)[mpyw](/maintainers/mpyw)[@mpyw](https://github.com/mpyw)

---

Top Contributors

[![mpyw](https://avatars.githubusercontent.com/u/1351893?v=4)](https://github.com/mpyw "mpyw (21 commits)")

---

Tags

base64php

### Embed Badge

![Health badge](/badges/mpyw-base-utf8/health.svg)

```
[![Health](https://phpackages.com/badges/mpyw-base-utf8/health.svg)](https://phpackages.com/packages/mpyw-base-utf8)
```

###  Alternatives

[ml/iri

IRI handling for PHP

276.4M6](/packages/ml-iri)[s9e/regexp-builder

Library that generates regular expressions that match a list of strings.

352.1M4](/packages/s9e-regexp-builder)[easy-slug/easy-slug

Laravel Package for creating a slug

1816.8k1](/packages/easy-slug-easy-slug)

PHPackages © 2026

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