drupol/phpmerkle
A fast and dynamic Merkle tree implementation
Maintainers
Fund package maintenance!
Requires
- php: >= 7.1.3
- ext-hash: *
- ext-json: *
Requires (Dev)
- drupol/php-conventions: ^1
- friends-of-phpspec/phpspec-code-coverage: ^4.3.2
- infection/infection: ^0.11. || ^0.12.2 || ^0.13.6 || ^0.14.4 || ^0.15.0
- jakub-onderka/php-parallel-lint: ^1.0
- phpspec/phpspec: ^5.1.2 || ^6.1 || ^7
- phpstan/phpstan: ^0.11.19
- phpunit/php-code-coverage: ^6.1.4 || ^7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT be5a097570084a2bc6da92bec47093deffad619a
- Pol Dellaiera <pol.dellaiera.woop@protonmail.com>
This package is auto-updated.
Last update: 2026-06-11 22:38:33 UTC
README
👁 Latest Stable Version
👁 GitHub stars
👁 Total Downloads
👁 GitHub Workflow Status
👁 Scrutinizer code quality
👁 Code Coverage
👁 Mutation testing badge
👁 Read the Docs
👁 License
👁 Say Thanks!
👁 Donate!
PhpMerkle
A fast PHP implementation of the Merkle tree using simple arrays.
Documentation
TODO.
Requirements
- PHP >= 7.1
Installation
composer require drupol/phpmerkle
Usage
The object has to be used just like a regular array.
<?php declare(strict_types=1); include './vendor/autoload.php'; $tree = new drupol\phpmerkle\Merkle(); $sentence = 'Science is made up of so many things that appear obvious after they are explained .'; foreach (explode('', $sentence) as $word) { $tree[] = $word; } echo $tree->hash(); // c689102cdf2a5b30c2e21fdad85e4bb401085227aff672a7240ceb3410ff1fb6
Code quality, tests and benchmarks
Every time changes are introduced into the library, Github run the tests and the benchmarks.
The library has tests written with PHPSpec.
Feel free to check them out in the spec directory. Run composer phpspec to trigger the tests.
Before each commit some inspections are executed with GrumPHP, run ./vendor/bin/grumphp run to check manually.
PHPBench is used to benchmark the library, to run the benchmarks: composer bench
PHPInfection is used to ensure that your code is properly tested, run composer infection to test your code.
Contributing
Feel free to contribute to this library by sending Github pull requests. I'm quite reactive :-)
