@blockchaincommons/uniform-resources - v1.0.0-beta.3
    Preparing search index...

    Reassembles a message from parts in any order, exactly as the reference's ur::fountain::Decoder does: a mixed part is reduced against the fragments known when it arrives and then buffered; a buffered part is reduced further only when a later simple part (or a fragment derived while processing one) arrives, so completion can need more parts than a decoder that re-reduces its buffer after every part. A later simple part replaces a fragment derived earlier, and the reassembled message is not checked against the parts' checksum field.

    Index
    • get done(): boolean

      Whether as many fragments are decoded as the message has; result is then defined or throws.

      Returns boolean

    • get progress(): number

      Fraction of the message's fragments decoded.

      Returns number

    • get result(): Uint8Array<ArrayBuffer> | undefined

      The message once done, else undefined: the decoded fragments in order, cut to messageLen. The decoder does not change once done, so the first outcome is kept and returned (or thrown) again.

      Returns Uint8Array<ArrayBuffer> | undefined

      Decoder when a fragment in 0..seqLen is missing or the fragments do not cover messageLen ("expected item"), or when a byte past messageLen is not zero ("invalid padding").

    • Feed a part. Returns whether it added information: false once done and for a repeated index set. The part's data is copied, never kept.

      Parameters

      Returns boolean

      InvalidParameter unless part is an object whose seqNum, seqLen and messageLen are non-negative safe integers, checksum a u32 and data a Uint8Array; Decoder for an empty part ("expected non-empty part") or one inconsistent with the first ("part is inconsistent with previous ones").

    • Forget every part received.

      Returns void