Debian Codegraph @

vendor/christian-riesen/base32/README.md

raw
1 base32
2 ======
3
4 Base32 Encoder/Decoder for PHP according to [RFC 4648](https://tools.ietf.org/html/rfc4648).
5
6 ![CI](https://github.com/ChristianRiesen/base32/workflows/CI/badge.svg)
7
8 [![Latest Stable Version](https://poser.pugx.org/christian-riesen/base32/v/stable.png)](https://packagist.org/packages/christian-riesen/base32) [![Total Downloads](https://poser.pugx.org/christian-riesen/base32/downloads.png)](https://packagist.org/packages/christian-riesen/base32) [![Latest Unstable Version](https://poser.pugx.org/christian-riesen/base32/v/unstable.png)](https://packagist.org/packages/christian-riesen/base32) [![License](https://poser.pugx.org/christian-riesen/base32/license.png)](https://packagist.org/packages/christian-riesen/base32)
9
10
11 Installation
12 -----
13
14 Use composer:
15
16 ```bash
17 composer require christian-riesen/base32
18 ```
19
20 Usage
21 -----
22
23 ```php
24 <?php
25
26 // Include class or user autoloader
27 use Base32\Base32;
28
29 $string = 'fooba';
30
31 // $encoded contains now 'MZXW6YTB'
32 $encoded = Base32::encode($string);
33
34 // $decoded is again 'fooba'
35 $decoded = Base32::decode($encoded);
36 ```
37
38 You can also use the extended hex alphabet by using the `Base32Hex` class instead.
39
40 About
41 =====
42
43 Initially created to work with the [one time password project](https://github.com/ChristianRiesen/otp), yet it can stand alone just as well as [Jordi Boggiano](http://seld.be/) kindly pointed out. It's the only Base32 implementation that passes the test vectors and contains unit tests as well.
44
45 Goal
46 ----
47 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.
48
49 Requirements
50 ------------
51
52 Works on PHP 7.2 and later, including PHP 8.0.
53
54 Tests run on PHPUnit 9.5, with PHP 7.3 and later. For PHP 7.2, tests use an older PHPUnit version.
55
56 Author
57 ------
58
59 Christian Riesen <[email protected]> http://christianriesen.com
60
61 Acknowledgements
62 ----------------
63
64 Base32 is mostly based on the work of https://github.com/NTICompass/PHP-Base32