selective / base32
基于RFC 4648的Base32
2.0.0
2020-04-03 20:48 UTC
Requires
- php: >=7.1.3
Requires (Dev)
- overtrue/phplint: ^1.1
- phpstan/phpstan: *
- phpunit/phpunit: ^6|^7
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-09-09 15:11:10 UTC
README
基于RFC 4648的Base32字符串编码器。
安装
通过Composer
$ composer require selective/base32
要求
- PHP 8.1+
使用
<?php use Selective\Base32\Base32; $str = 'abc 1234'; $base32 = new Base32(); // Encode // MFRGGIBRGIZTI==== $encoded = $base32->encode($str); // Decode // abc 1234 echo $base32->decode($encoded);
无填充,只使用小写
<?php $str = 'abc 1234'; // Encode $encoded = $base32->encode($str, false); // mfrggibrgizti $encoded = strtolower($enc); // Decode echo $base32->decode($encoded);
测试
$ composer test
贡献
请参阅CONTRIBUTING和CONDUCT以获取详细信息。
致谢
- Bryan Ruiz
许可证
MIT许可证(MIT)。请参阅许可证文件以获取更多信息。