Decodes multiple UR parts back into a single UR.
This reassembles multipart URs that were encoded using fountain codes. The decoder can handle out-of-order reception and packet loss.
const decoder = new MultipartDecoder();for (const urPart of urParts) { decoder.receive(urPart); if (decoder.isComplete()) { const ur = decoder.message(); break; }} Copy
const decoder = new MultipartDecoder();for (const urPart of urParts) { decoder.receive(urPart); if (decoder.isComplete()) { const ur = decoder.message(); break; }}
Receives a UR part string.
A UR part string (e.g., "ur:bytes/1-10/..." or "ur:bytes/...")
If the part doesn't start with "ur:"
If the type doesn't match previous parts
Checks if the message is complete.
Gets the decoded UR message.
The decoded UR, or null if not yet complete
Decodes multiple UR parts back into a single UR.
This reassembles multipart URs that were encoded using fountain codes. The decoder can handle out-of-order reception and packet loss.
Example