public function appendData(string $data): self
    {
        if (empty($this->nodes)) {
            $prevHash = $this->firstPrevHash;
        } else {
            $last = $this->getLastNode();
            $prevHash = $last->getHash(true);
        }
        $newNode = new Node($data, $prevHash);
        $this->nodes[] = $newNode;

        SodiumCompat::crypto_generichash_update(
            $this->summaryHashState,
            $newNode->getHash(true)
        );
        return $this;
    }
public function appendData(string $data): self
    {
        if (empty($this->nodes)) {
            $prevHash = $this->firstPrevHash;
        } else {
            $last = $this->getLastNode();
            $prevHash = $last->getHash(true);
        }
        $newNode = new Node($data, $prevHash);
        $this->nodes[] = $newNode;

        SodiumCompat::crypto_generichash_update(
            $this->summaryHashState,
            $newNode->getHash(true)
        );
        return $this;
    }
public function appendData ( string $ data ) : self { if ( empty ( $ this -> nodes ) ) { $ prevHash = $ this -> firstPrevHash ; } else { $ last = $ this -> getLastNode ( ) ; $ prevHash = $ last -> getHash ( true ) ; } $ newNode = new Node ( $ data , $ prevHash ) ; $ this -> nodes [ ] = $ newNode ; SodiumCompat :: crypto_generichash_update ( $ this -> summaryHashState , $ newNode -> getHash ( true ) ) ; return $ this ; }
Append a new Node.

@param string $data
@return self

@throws \SodiumException
Append a new Node .