Documentation

QedShareCli.FastInfo

info and convert on byte arrays #

describeShares and convertShares (in Pipeline) read every share with decodeShare, whose payload is a list (24 bytes per payload byte). Neither needs it: info only reports the payload's length, and convert writes the payload back out.

describeSharesBytes and convertSharesBytes read the shares with decodePackedForm instead. convertSharesBytes returns the UTF-8 bytes of each converted share. Both are proven to return exactly what the list versions return (describeSharesBytes_eq, convertSharesBytes_eq).

What info reads from a packed record (infoOf, without the payload list).

Equations
Instances For

    What info needs from one share: whether it is in the hex form, and what was read from it (or the error). The payload is not kept.

    Equations
    Instances For

      describeShares on shares that were already read with infoOfText.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        describeShares, reading the shares into byte arrays (describeSharesBytes_eq).

        Equations
        Instances For

          Convert one share that was already read: the UTF-8 bytes of the share in the given form, or the error from reading it.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            convertShares on shares that were already converted one by one with convertPacked: all of them, or the first error.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              convertShares on byte arrays: the UTF-8 bytes of each share in the given form (convertSharesBytes_eq).

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Equality with the list versions #

                theorem QedShare.Cli.infoOfBytes_eq (label : String) (bs : ByteArray) (h : bs.IsValidUTF8) :
                infoOfBytes label bs h = infoOfText label { toByteArray := bs, isValidUTF8 := h }

                infoOfBytes is infoOfText on the text with those bytes.

                What info reads is the same from the packed record.

                describeSharesBytes computes exactly describeShares. For every list of labelled share strings, info on byte arrays returns the same lines and the same flag, or the same error.

                theorem QedShare.Cli.mapM_id_map {α β ε : Type} (f : α → Except ε β) (l : List α) :

                Taking the first error of results computed one by one is mapM.

                The UTF-8 bytes of a hex share, written from the packed record.

                convertSharesBytes computes exactly convertShares. For every form and list of labelled share strings, convert on byte arrays returns the UTF-8 bytes of the shares convertShares returns, or the same error.