PHP Class ParagonIE\Halite\Structure\TrimmedMerkleTree
A variant of a Merkle tree that silently passes the dangling nodes up
instead of duplicating and then hashing.
If you're planning to implement this into some sort of crypto-currency,
you'll almost certainly want to use the Trimmed variant.
This library makes heavy use of return-type declarations,
which are a PHP 7 only feature. Read more about them here:
Show file
Open project: paragonie/halite
Public Methods
Method |
Description |
|
getExpandedTree ( variadic $nodes ) : MerkleTree |
Merkle Trees are immutable. Return a replacement with extra nodes. |
|
Protected Methods
Method |
Description |
|
calculateRoot ( ) : string |
Calculate the Merkle root, taking care to distinguish between
leaves and branches (0x01 for the nodes, 0x00 for the branches)
to protect against second-preimage attacks |
|
Method Details
calculateRoot()
protected method
Calculate the Merkle root, taking care to distinguish between
leaves and branches (0x01 for the nodes, 0x00 for the branches)
to protect against second-preimage attacks
getExpandedTree()
public method
Merkle Trees are immutable. Return a replacement with extra nodes.
public getExpandedTree ( variadic $nodes ) : MerkleTree |
$nodes |
variadic |
|
return |
MerkleTree |
|