PHP Classes
elePHPant
Icontem

PHP Convert Base36: Encode and decode data using Base36 encoding

Recommend this page to a friend!
  Info   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-04-19 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 67 This week: 4All time: 9,399 This week: 99Up
Version License PHP version Categories
base36 1.0MIT/X Consortium ...5PHP 5, Text processing
Description Author

This class can encode and decode data using Base36 encoding.

It can take a string of data and encodes it using the Base36 encoding.

The class can also do the opposite, i.e. decode a string previously encoded using Base36 encoding and revert to the original data string.

  Performance   Level  
Name: Chun-Sheng, Li <contact>
Classes: 6 packages by
Country: Taiwan Taiwan
Age: 25
All time rank: 36719 in Taiwan Taiwan
Week rank: 64 Up1 in Taiwan Taiwan Up
Innovation award
Innovation award
Nominee: 1x

Details

Base36

[![Latest Version on Packagist][ico-version]][link-packagist] [![Software License][ico-license]](LICENSE.md) [![Build Status][ico-travis]][link-travis] [![Coverage Status][ico-scrutinizer]][link-scrutinizer] [![Quality Score][ico-code-quality]][link-code-quality] [![Total Downloads][ico-downloads]][link-downloads]

Base36 string encode and decode.

Installation

Via Composer

$ composer require odan/base36

Requirements

  • PHP 7.0+

Usage

use Odan\Encoding\Base36;

$str = "abc 1234";

// Encode
$base36 = new Base36();
$enc = $base36->encode($str); // MFRGGIBRGIZTI====

// Decode
echo $base36->decode($enc); // abc 1234

Without padding and only lowercase

$str = "abc 1234";

// Encode
$enc = $base36->encode($str, false);
$enc = strtolower($enc); // mfrggibrgizti

// Decode
echo $base36->decode(strtoupper($enc));

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Credits

  • Bryan Ruiz

License

The MIT License (MIT). Please see License File for more information.

[ico-version]: https://img.shields.io/packagist/v/odan/base36.svg?style=flat-square [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square [ico-travis]: https://img.shields.io/travis/odan/base36/master.svg?style=flat-square [ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/odan/base36.svg?style=flat-square [ico-code-quality]: https://img.shields.io/scrutinizer/g/odan/base36.svg?style=flat-square [ico-downloads]: https://img.shields.io/packagist/dt/odan/base36.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/odan/base36 [link-travis]: https://travis-ci.org/odan/base36 [link-scrutinizer]: https://scrutinizer-ci.com/g/odan/base36/code-structure [link-code-quality]: https://scrutinizer-ci.com/g/odan/base36 [link-downloads]: https://packagist.org/packages/odan/base36 [link-author]: https://github.com/:author_username [link-contributors]: ../../contributors

  Files folder image Files  
File Role Description
Files folder imagesrc (1 directory)
Files folder imagetests (2 files)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file build.xml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file CONDUCT.md Data Auxiliary data
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
Files folder imageEncoding (1 file)

  Files folder image Files  /  src  /  Encoding  
File Role Description
  Plain text file Base36.php Class Class source

  Files folder image Files  /  tests  
File Role Description
  Plain text file Base36Test.php Class Class source
  Accessible without login Plain text file test.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:67
This week:4
All time:9,399
This week:99Up