Skip to content

drupol/phpmerkle

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 

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 :-)

About

A fast and dynamic Merkle tree implementation

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages