PHPackages                             mindplay/nbase - 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. mindplay/nbase

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

mindplay/nbase
==============

Convert numbers between arbitrary notations

1.0.0(9y ago)2511MITPHPPHP &gt;=5.4

Since Aug 15Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (1)

mindplay/nbase
==============

[](#mindplaynbase)

This script provides a converter between numbers encoded with *n*-base notation.

[![PHP Version](https://camo.githubusercontent.com/581d3b86ad2a67effa63792b85b18395acbbc26aae6ab4a453ed555677b8761c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e342532422d626c75652e737667)](https://packagist.org/packages/mindplay/nbase)[![Build Status](https://camo.githubusercontent.com/3ca358b63a91ed93cbb8daf4fc938f427b932f7d4839d5751db66bd42296342f/68747470733a2f2f7472617669732d63692e6f72672f6d696e64706c61792d646b2f6e626173652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mindplay-dk/nbase)

#### Usage

[](#usage)

Any notation (using ASCII characters) can be used.

For example, to convert from decimal to hexadecimal notation:

```
$converter = new NBaseConverter();

echo $converter->convert('12345', 'dec', 'hex'); // => '3039'
```

You can define your custom notations via the public `$notations` property - the notation names supplied to the `convert` method must be defined in `$notation`.

Common notations such as `bin`, `hex`, `dec` and `oct` are pre-defined, as well as `base62` and `base64`, plus a URL-safe variation of `base64` called `url64` which uses `-` and `_` instead of the standard `+` and `/` used by `base64`.

Also, a useful notation `legible` is available, which excludes visually ambiguous characters such as `1` and `l`, `0` and `O`, which can be used to shorten numeric IDs, e.g. for use in URLs.

Refer to the [source code](src/NBaseConverter.php) for a list of pre-defined notations.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3606d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9445f567f43ee7a963270651e40e533634586f959e4df3d5398d001b1cb49be8?d=identicon)[mindplay.dk](/maintainers/mindplay.dk)

---

Top Contributors

[![mindplay-dk](https://avatars.githubusercontent.com/u/103348?v=4)](https://github.com/mindplay-dk "mindplay-dk (3 commits)")

### Embed Badge

![Health badge](/badges/mindplay-nbase/health.svg)

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

###  Alternatives

[lipemat/phpstan-wordpress

Phpstan extension for working with WordPress

1460.1k1](/packages/lipemat-phpstan-wordpress)

PHPackages © 2026

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