Kanboard-Prod/vendor/christian-riesen/base32
Frederic Guillot 9e2b2a32fd Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
..
src Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
tests Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
.gitignore Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
.scrutinizer.yml Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
.travis.yml Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
LICENSE Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
README.md Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
build.xml Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
composer.json Include composer dependencies in repo 2017-10-25 16:22:10 -07:00
phpunit.xml.dist Include composer dependencies in repo 2017-10-25 16:22:10 -07:00

README.md

base32

Base32 Encoder/Decoder for PHP according to RFC 4648

Build Status HHVM Status

Latest Stable Version Total Downloads Latest Unstable Version License

Do you like this? Flattr it:

Flattr base32

Usage

<?php

// Include class or user autoloader
use Base32\Base32;

$string = 'fooba';

$encoded = Base32::encode($string);
// $encoded contains now 'MZXW6YTB'

$decoded = Base32::decode($encoded);
// $decoded is again 'fooba'

About

Use

Initially created to work with the one time password project, yet it can stand alone just as well as Jordi Boggiano kindly pointed out. It's the only Base32 implementation I could make work that passes the test vectors (and contains unit tests).

Goal

Have a RFC compliant Base32 encoder and decoder. The implementation could be improved, but for now, it does the job and has unit tests. Ideally, the class can be enhanced while the unit tests keep passing.

Requirements

PHP 5.3.x+

If you want to run the tests, PHPUnit 3.6 or up is required.

Author

Christian Riesen chris.riesen@gmail.com http://christianriesen.com

Acknowledgements

Base32 is mostly based on the work of https://github.com/NTICompass/PHP-Base32