Skip to content

BeautyInfo/base32

 
 

Repository files navigation

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.

Packages

No packages published

Languages

  • PHP 100.0%