Download the PHP package cardano-php/bech32 without Composer
On this page you can find all versions of the php package cardano-php/bech32. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cardano-php/bech32
More information about cardano-php/bech32
Files in cardano-php/bech32
Package bech32
Short Description A Bech32 encoder/decoder for Cardano ecosystem assets
License Apache-2.0
Informations about the package bech32
Bech32 Encoder/Decoder for Cardano
This library provides a pure PHP implementation of a Bech32 Encoder/Decoder tailored for use with the Cardano blockchain. It allows developers to seamlessly encode and decode Bech32 strings, which are widely used in Cardano addresses and other blockchain-related data.
Features
- Pure PHP Implementation: No external dependencies, making it lightweight and easy to integrate.
- Cardano-Specific: Designed to meet the encoding and decoding requirements of the Cardano blockchain.
- Simple API: Intuitive methods for both encoding and decoding.
Installation
To install the library, use Composer:
Alternatively, you can download the source code and include it manually in your project:
Usage
Encoding
Expected Output:
Decoding
Expected Output
Decoding a Cardano Address
Example PHP Code:
Output:
Encoding Cardano Address
Example PHP Code:
Error Handling
Ensure to handle potential exceptions when decoding invalid Bech32 strings:
Requirements
- PHP 8.2 or later
Tests
Run the tests to ensure the library works as expected:
Note: This will also generate code coverage reports that can be viewed in the
./coverage
folder.
Contributing
Contributions are welcome! Feel free to fork the repository and submit a pull request. Ensure to include tests for any new features or bug fixes.
License
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.
Acknowledgments
This library was inspired by the Bech32 implementation originally by Bit-Wasp Bech32 Implementation and Cardano CIP-0019.
All versions of bech32 with dependencies
ext-sodium Version *