drupol / phpmerkle
快速动态的Merkle树实现
2.2.1
2019-12-11 07:43 UTC
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-09-11 18:05:48 UTC
README
PhpMerkle
使用简单数组快速实现的PHP版本的Merkle树。
文档
待办事项。
需求
- PHP >= 7.1
安装
composer require drupol/phpmerkle
用法
对象的使用方式与常规数组相同。
<?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
代码质量、测试和基准测试
每次在库中引入更改时,Github都会运行测试和基准测试。
库使用PHPSpec编写了测试。您可以在spec
目录中查看它们。运行composer phpspec
以触发测试。
在每次提交之前,都会使用GrumPHP执行一些检查,手动运行./vendor/bin/grumphp run
以进行检查。
使用PHPBench对库进行基准测试,要运行基准测试:运行composer bench
使用PHPInfection确保您的代码得到适当的测试,运行composer infection
以测试您的代码。
贡献
请自由地向此库发送Github pull请求。我非常积极回应:-)