PHPackages                             amirax/base62 - 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. amirax/base62

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

amirax/base62
=============

Base62 encoder and decoder

0.1.1(8y ago)2111MITPHPPHP ^5.6 || ^7.0

Since Jul 15Pushed 8y ago2 watchersCompare

[ Source](https://github.com/amirax/base62)[ Packagist](https://packagist.org/packages/amirax/base62)[ Docs](https://github.com/amirax/base62)[ RSS](/packages/amirax-base62/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Base62 encoder and decoder
==========================

[](#base62-encoder-and-decoder)

[![Latest Version](https://camo.githubusercontent.com/3b045d68b1711bc439ca72c12704801f9116752ce5d8576af65c670a66a7d98a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d697261782f6261736536322e7376673f7374796c653d666c6174)](https://packagist.org/packages/amirax/base62)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/a3ff9a13e47c3122554b49a2f63ac8e177ac1c2883c77abb28b57926cbabc5e5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616d697261782f6261736536322f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/amirax/base62)![Codacy grade](https://camo.githubusercontent.com/7474d0c27b06ba179674ef9f3c5a7b1713fd6c0e5ca079c3f432035807cd007e/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f62646336353661313037646434643634613532363831386661636439363061302e7376673f7374796c653d666c6174)

Install
-------

[](#install)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run:

```
composer require amirax/base62

```

Usage
-----

[](#usage)

This package use encoder based on pure PHP. Library can encode strings, integers or bytes.

```
use Amirax\Base62;

$base62 = new Base62();
echo $encodedData = $base62->encode('Hello World!');    // T8dgcjRGkZ3aysdN
echo $base62->decode($encodedData);                     // Hello World!
```

Also you can use a salt:

```
use Amirax\Base62;

echo (new Base62())->encode('Hello World!');                    // T8dgcjRGkZ3aysdN
echo (new Base62('my_secret_salt'))->encode('Hello World!');    // e4NKCYHiEbv8qjNx
```

Or you can set custom alphabet:

```
use Amirax\Base62;

// Custom alphabet without salt. Output: 2678lx5gvmsv1dro9b5
echo (new Base62('', '0123456789abcdefghijklmnopqrstuvwxyz'))->encode('Hello World!');

// ... and with salt. Output: v79ljqkhx3bxnafi2mk
echo (new Base62('my_secret_salt', '0123456789abcdefghijklmnopqrstuvwxyz'))->encode('Hello World!');
```

Testing
-------

[](#testing)

You can run tests either run:

```
composer test

```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

3259d ago

PHP version history (2 changes)0.1.0PHP ^5.4 || ^7.0

0.1.1PHP ^5.6 || ^7.0

### Community

Maintainers

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

---

Top Contributors

[![maxvoronov](https://avatars.githubusercontent.com/u/8292606?v=4)](https://github.com/maxvoronov "maxvoronov (7 commits)")

---

Tags

encodedecodebase62

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/amirax-base62/health.svg)

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

###  Alternatives

[hashids/hashids

Generate short, unique, non-sequential ids (like YouTube and Bitly) from numbers

5.4k50.9M308](/packages/hashids-hashids)[sqids/sqids

Generate short YouTube-looking IDs from numbers

6771.8M46](/packages/sqids-sqids)[christian-riesen/base32

Base32 encoder/decoder according to RFC 4648

13333.2M71](/packages/christian-riesen-base32)[torann/hashids

Laravel package for Hashids

54341.1k](/packages/torann-hashids)[skleeschulte/base32

Base32 encoding and decoding class (RFC 4648, RFC 4648 extended hex, Crockford, z-base-32/Zooko).

17320.5k9](/packages/skleeschulte-base32)[dflydev/base32-crockford

Encode/decode numbers using Douglas Crockford's Base32 Encoding

14416.4k1](/packages/dflydev-base32-crockford)

PHPackages © 2026

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