Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottchiefbaker/php-base85
PHP Base85 library
https://github.com/scottchiefbaker/php-base85
Last synced: 9 days ago
JSON representation
PHP Base85 library
- Host: GitHub
- URL: https://github.com/scottchiefbaker/php-base85
- Owner: scottchiefbaker
- License: gpl-3.0
- Created: 2014-01-07T22:35:33.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-04-13T00:14:34.000Z (7 months ago)
- Last Synced: 2024-10-17T22:59:56.308Z (19 days ago)
- Language: PHP
- Size: 44.9 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHP Base85
==========A pure PHP extension to encode and decode data with [base85](http://en.wikipedia.org/wiki/Ascii85).
Usage:
------
```PHP
require("/path/to/base85.class.php");$encoded = base85::encode('Base85 is pretty cool');
$decoded = base85::decode(':e4D*;K$&\Er');print "Encoded: $encoded\n";
print "Decoded: $decoded\n";
```Should output:
```
Encoded: 6=FqH3&MgmF!,FBATW$>+Cf>.C]
Decoded: PHP Rocks
```**Note:** There is a PHP extension written in C also named [php-base85](https://github.com/raducu/php-base85).
That library is most likely faster, but may be harder to install (requires
the ability to load extensions).Note on 32bit:
--------------
Base85 requires doing math on numbers larger than 2^31. 32bit PHP cannot
do math on an integer this large. On 32bit systems we use the `gmp` extension
to work around this limitation. If you are on a 32bit system make sure you
have the `gmp` module enabled in PHP.All unit tests pass on a 32bit RaspberryPi.