PHP Classes

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    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 92 All time: 9,898 This week: 206Up
Version License PHP version Categories
base36 1.0.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.

Picture of Chun-Sheng, Li
  Performance   Level  
Name: Chun-Sheng, Li <contact>
Classes: 28 packages by
Country: Taiwan Taiwan
Age: 30
All time rank: 22526 in Taiwan Taiwan
Week rank: 6 Up1 in Taiwan Taiwan Up
Innovation award
Innovation award
Nominee: 14x

Winner: 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:92
This week:0
All time:9,898
This week:206Up