PHPackages                             mfonte/base62x - 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. [Security](/categories/security)
4. /
5. mfonte/base62x

ActiveLibrary[Security](/categories/security)

mfonte/base62x
==============

A Base62x PHP implementation library, that can be used in frameworks like Laravel, that supports encoding/decoding of strings, arrays, objects, and binary resources. It also supports Gzip compression/decompression and symmetric encryption.

v1.4.0(3y ago)33061[2 issues](https://github.com/mauriziofonte/php-base62x/issues)Apache-2.0PHPPHP &gt;=7.2CI failing

Since Apr 20Pushed 3y ago2 watchersCompare

[ Source](https://github.com/mauriziofonte/php-base62x)[ Packagist](https://packagist.org/packages/mfonte/base62x)[ RSS](/packages/mfonte-base62x/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

PHP Base62x Library
===================

[](#php-base62x-library)

This library can be used to encode strings in **Base62x** format.

The reference implementation of *Base62x* has been taken by this repository:

Stating the original author repository, **Base62x is an alternative approach to Base 64 without symbols in output.**

*Base62x* is an **non-symbolic Base64 encoding scheme**. It can be used safely in computer file systems, programming languages for data exchange, internet communication systems, etc, and it is an ideal substitute and successor of many variants of Base64 encoding scheme.

This repository is a wrapper around **wadelau/Base62x** repository, and is specifically crafted for PHP, with composer support.

It can be integrated into any framework, like Laravel, to enable *Base62x* support out of the box.

[![Latest Stable Version](https://camo.githubusercontent.com/ccb27210e9eef63dd989b8cda712f4979556e44cb78926e41f138272db96d1ae/68747470733a2f2f706f7365722e707567782e6f72672f6d666f6e74652f626173653632782f762f737461626c65)](https://packagist.org/packages/mfonte/base62x)[![Total Downloads](https://camo.githubusercontent.com/18714021743f6fef35cc2fe5d286ef0bf3acd7228aebb7f0a0b96fe76270368b/68747470733a2f2f706f7365722e707567782e6f72672f6d666f6e74652f626173653632782f646f776e6c6f616473)](https://packagist.org/packages/mfonte/base62x)[![Build Status](https://camo.githubusercontent.com/6e4e8310ffd323e277058c6fb1f29e98857831df3cceb9d282d04b4e60133b6b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617572697a696f666f6e74652f7068702d626173653632782f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mauriziofonte/php-base62x/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8e1b420f57e37326bc7e879f833b0b0d4c464d8b43caebbf348fc6bea7f8cc6f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617572697a696f666f6e74652f7068702d626173653632782f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/mauriziofonte/php-base62x/)

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

[](#installation)

Simple enough.

`composer require mfonte/base62x`

Required environment:

1. PHP **&gt;= 7.2**
2. `gzip` module, for gzip compression support
3. `openssl` module, for encryption support

### Use cases

[](#use-cases)

Base64 is notoriously bad to be used in *GET* strings. With this library, you can safely encode (and compress) and pass your data via **GET parameters**.

Another use case is when you have to **communicate binary data** from one server to another.

Many Apache modules (like Mod Security) will do some strange things, already seen in the wild, while passing raw binary data or complex jugglary in server2server communication.

Sure, you can use native `base64_encode()` and `base64_decode()` on both ends, but using this library not only you're encoding data, **you can also compress and encrypt it on the go!**.

### Basic Usage

[](#basic-usage)

Usage is simple enough with a nice, expressive API:

```
