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;
    }