Class SketchSet

java.lang.Object
ai.badmonkey.agentspaces.content.tree.sync.SketchSet

public final class SketchSet extends Object
A set of CIDs as sketch items (PDT 2 phase 5, P2-K-02, P2-K-03): the id of a CID is its 32-byte sha2-256 digest (ยง3.6), and every item stands at timestamp 0. A holding's issued differs from holder to holder, so the same root would stand at two places in two members' sets; with one timestamp the items sort by digest alone and one root is one item everywhere. A text that is no canonical sha2-256 CID is left out, and a raw and a dag-cbor CID of one digest are one item.
  • Method Details

    • of

      public static SketchSet of(Collection<String> cids)
      The set of a collection of CIDs.
      Parameters:
      cids - the CIDs
      Returns:
      the set
    • size

      public int size()
      The items.
    • cid

      public Optional<String> cid(byte[] id)
      The CID this set holds for an id.
      Parameters:
      id - a 32-byte digest
      Returns:
      the CID, or empty when the set holds no CID of that digest