1. Go to this page and download the library: Download pitsolu/merkle-tree library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$slimLyrics = $realSlimShadyLyrics = array(
"I'm Slim Shady, yes I'm the real Shady",
"All you other Slim Shadys are just imitating",
"So won't the real Slim Shady please stand up",
"Please stand up, please stand up?"
);
$errIdx = 2;
$slimLyrics[$errIdx] = sprintf("%s ???", $slimLyrics[$errIdx]);
foreach($realSlimShadyLyrics as $idx=>$lyric){
$tree = $this->merkleTree->add(new Merkle\LeafItem($lyric));
$xtree = $this->merkleTree->add(new Merkle\LeafItem($slimLyrics[$idx]));
if(key($tree)!=key($xtree))
throw new \Exception("Slims lyrics don't match!");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.