Property | Type | Description | |
---|---|---|---|
$nodes | |||
$outputSize | integer | ||
$personalization | string | ||
$root | string | ||
$rootCalculated | boolean |
Method | Description | |
---|---|---|
__construct ( variadic |
Instantiate a Merkle tree | |
getExpandedTree ( variadic |
Merkle Trees are immutable. Return a replacement with extra nodes. | |
getRoot ( boolean $raw = false ) : string | Get the root hash of this Merkle tree. | |
getSizeRoundedUp ( integer $inputSize ) : integer | Let's go ahead and round up to the nearest multiple of 2 | |
setHashSize ( integer $size ) : self | Set the hash output size. | |
setPersonalizationString ( string $str = '' ) : self | Sets the personalization string for the Merkle root calculation | |
triggerRootCalculation ( ) : self | Explicitly recalculate the Merkle root |
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 |
public __construct ( variadic |
||
$nodes | variadic |
protected calculateRoot ( ) : string | ||
return | string |
public getExpandedTree ( variadic |
||
$nodes | variadic |
|
return |
public static getSizeRoundedUp ( integer $inputSize ) : integer | ||
$inputSize | integer | |
return | integer |
public setHashSize ( integer $size ) : self | ||
$size | integer | |
return | self |
public setPersonalizationString ( string $str = '' ) : self | ||
$str | string | |
return | self |
public triggerRootCalculation ( ) : self | ||
return | self |