Download the PHP package butterfly-team/avalanche-cb58 without Composer
On this page you can find all versions of the php package butterfly-team/avalanche-cb58. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download butterfly-team/avalanche-cb58
More information about butterfly-team/avalanche-cb58
Files in butterfly-team/avalanche-cb58
Package avalanche-cb58
Short Description Base58 encoder and decoder for arbitrary data
License MIT
Homepage https://github.com/tuupola/base58
Informations about the package avalanche-cb58
Base58
This library implements Base58 encoding. In addition to integers it can encode and decode any arbitrary data. That said, Base58 is well suited for decoding big integers but is not designed to decode long portions of binary data.
Install
Install with composer.
This branch requires PHP 7.1 or up. The older 1.x branch supports also PHP 5.6 and 7.0.
Usage
This package has both pure PHP and GMP based encoders. By default encoder and decoder will use GMP functions if the extension is installed. If GMP is not available pure PHP encoder will be used instead.
If you are encoding to and from integer use the implicit decodeInteger() and encodeInteger() methods.
Also note that encoding a string and an integer will yield different results.
Character sets
By default Base58 uses GMP style character set. Shortcuts are provided for Bitcoin, Flickr, Ripple and IPFS character sets. You can also use any custom 58 characters.
Base58Check support
This library supports the Base58Check encoding used in Bitcoin addresses. Decoding validates both version and the checksum. If either of them fails a RuntimeException
will be thrown;
Speed
Install GMP if you can. It is much faster pure PHP encoder. Below benchmarks are for encoding random_bytes(128)
data. BCMatch encoder is also included but it is mostly just a curiosity. It is too slow to be usable.
Static Proxy
If you prefer to use static syntax use the provided static proxy.
Testing
You can run tests either manually or automatically on every code change. Automatic tests require entr to work.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.