public function getRoot(bool $raw = false): string
    {
        if (!$this->rootCalculated) {
            $this->root = $this->calculateRoot();
        }
        return $raw
            ? $this->root
            : Hex::encode($this->root);
    }
public function getRoot(bool $raw = false): string
    {
        if (!$this->rootCalculated) {
            $this->root = $this->calculateRoot();
        }
        return $raw
            ? $this->root
            : Hex::encode($this->root);
    }
public function getRoot ( bool $ raw = false ) : string { if ( ! $ this -> rootCalculated ) { $ this -> root = $ this -> calculateRoot ( ) ; } return $ raw ? $ this -> root : Hex :: encode ( $ this -> root ) ; }
Get the root hash of this Merkle tree.

@param bool $raw - Do we want a raw string instead of a hex string?

@return string
@throws CannotPerformOperation

@return string
@throws CannotPerformOperation
@throws \TypeError
Get the root hash of this Merkle tree .