drupol / phpmerkle
A fast and dynamic Merkle tree implementation
Fund package maintenance!
drupol
Installs: 1 735
Dependents: 3
Suggesters: 0
Security: 0
Stars: 3
Watchers: 5
Forks: 0
Open Issues: 0
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
This package is auto-updated.
Last update: 2024-11-11 18:29:50 UTC
README
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 :-)