PHPackages                             vandalorumrex/base58 - 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. vandalorumrex/base58

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

vandalorumrex/base58
====================

Base58 Encoding and Decoding Library for PHP

v1.1.6(1y ago)1366MITPHP

Since Jan 9Pushed 1y agoCompare

[ Source](https://github.com/VandalorumRex/base58php)[ Packagist](https://packagist.org/packages/vandalorumrex/base58)[ RSS](/packages/vandalorumrex-base58/feed)WikiDiscussions master Synced 1mo ago

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

Base58 Encoding and Decoding Library for PHP
============================================

[](#base58-encoding-and-decoding-library-for-php)

[![Build Status](https://camo.githubusercontent.com/b137e9429ff96a65f0e8f553ef8033f9fdebde0b8541b18b0e754e07a5ff77bb/68747470733a2f2f7472617669732d63692e6f72672f7374657068656e2d68696c6c2f6261736535387068702e706e67)](https://travis-ci.org/stephen-hill/base58php)[![Packagist Release](https://github.com/VandalorumRex/base58php/raw/master/version.svg)](https://packagist.org/packages/vandalorumrex/base58)[![MIT License](https://camo.githubusercontent.com/8a3593473e8b5bb2b1bd871bf00291851ba985af4d3b2be506ba3f00d360a5e9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7374657068656e68696c6c2f6261736535382e737667)](https://github.com/stephen-hill/base58php/blob/master/license)[![Flattr this](https://camo.githubusercontent.com/d72e55c5c5baef1656773d3bb52c77a2566196f35e85f394f3196e2f748d679e/68747470733a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=stephen-hill&url=https%3A%2F%2Fgithub.com%2Fstephen-hill%2Fbase58php)

Long Term Support
-----------------

[](#long-term-support)

Each major version of this library will be supported for 5 years after it's initial release. Support will be provided for security and bug fixes.

Version 1 will therefore be supported until the 11th September 2025.

Background
----------

[](#background)

I wanted a replacement for Base64 encoded strings and the [Base58 encoding used by Bitcoin](https://en.bitcoin.it/wiki/Base58Check_encoding) looked ideal. I looked around for an existing PHP library which would directly convert a string into Base58 but I couldn't find one, or at least one that worked correctly and was also well tested.

So I decided to create a library with the following goals:

- Encode/Decode PHP Strings
- Simple and easy to use
- Fully Tested
- Available via Composer

Requirements
------------

[](#requirements)

This library has the following requirements:

- PHP =&gt; 8.3
- BC Math Extension

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

[](#installation)

I recommend you install this library via Composer.

```
{
    "require": {
        "vandalorumrex/base58": "~1.0"
    }
}
```

Basic Usage
-----------

[](#basic-usage)

```
require_once('vendor/autoload.php');

$base58 = new StephenHill\Base58();

$base58->encode('Hello World');
$base58->decode('JxF12TrwUP45BMd');
```

Advanced Usage
--------------

[](#advanced-usage)

By default this library chooses the encoding service provider to use, either GMPService or BCMathService (in that order). If you want to specify one of the included services or your own, you can inject it into the constructor.

```
require_once('vendor/autoload.php');

$gmp = new StephenHill\GMPService();
$base58 = new StephenHill\Base58(null, $gmp);

$base58->encode('Hello World');
$base58->decode('JxF12TrwUP45BMd');
```

Also by default, this library uses Bitcoin's Base58 alphabet. If you want to use another variant, you can do this in the constructor.

```
require_once('vendor/autoload.php');

// Flickr's Base58 Alphabet
$base58 = new StephenHill\Base58('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ');

$base58->encode('Hello World');
$base58->decode('iXf12sRWto45bmC');
```

Contributing
------------

[](#contributing)

I welcome everyone to contribute to this library. Please see the Contributing document for details.

License
-------

[](#license)

This library is license under the MIT License (MIT). Please see License File for more information.

Credits
-------

[](#credits)

This library was forked from [Stephen Hill's](https://github.com/stephen-hill) Base58 methods on Github .

Some of the unit tests were based on the following:

-
-

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance44

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.6% 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 ~0 days

Total

2

Last Release

494d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0718ee6a9562679d6fa001109fde0c93f163b7cc679d90801b00ba33f2bfc1e6?d=identicon)[VandalorumRex](/maintainers/VandalorumRex)

---

Top Contributors

[![stephen-hill](https://avatars.githubusercontent.com/u/205619?v=4)](https://github.com/stephen-hill "stephen-hill (101 commits)")[![VandalorumRex](https://avatars.githubusercontent.com/u/12428558?v=4)](https://github.com/VandalorumRex "VandalorumRex (12 commits)")[![jsjohnst](https://avatars.githubusercontent.com/u/5507?v=4)](https://github.com/jsjohnst "jsjohnst (2 commits)")[![Fil](https://avatars.githubusercontent.com/u/7001?v=4)](https://github.com/Fil "Fil (1 commits)")[![jonaswebdev](https://avatars.githubusercontent.com/u/1163141?v=4)](https://github.com/jonaswebdev "jonaswebdev (1 commits)")[![orthographic-pedant](https://avatars.githubusercontent.com/u/14522744?v=4)](https://github.com/orthographic-pedant "orthographic-pedant (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vandalorumrex-base58/health.svg)

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

###  Alternatives

[wesselperik/nova-status-field

A Laravel Nova field for displaying statuses.

30213.5k](/packages/wesselperik-nova-status-field)[karnbrockgmbh/yii2-modal-ajax

A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside

135.9k](/packages/karnbrockgmbh-yii2-modal-ajax)

PHPackages © 2026

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