Skip to content

Latest commit

 

History

History
82 lines (57 loc) · 2.09 KB

README.md

File metadata and controls

82 lines (57 loc) · 2.09 KB

Base32

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Base32 string encoder based on RFC 4648.

Installation

Via Composer

$ composer require odan/base32

Requirements

  • PHP 7.0+

Usage

use Odan\Encoding\Base32;

$str = "abc 1234";

// Encode
$base32 = new Base32();
$encoded = $base32->encode($str); // MFRGGIBRGIZTI====

// Decode
echo $base32->decode($encoded); // abc 1234

Without padding and only lowercase

$str = "abc 1234";

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

// Decode
echo $base32->decode($encoded);

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.