Skip to main content

Module seq

Module seq 

Source
Expand description

Wrap-safe modular sequence-number arithmetic (comparable to RFC 1982 serial-number arithmetic) over a bits-wide sequence space.

The one implementation behind rist-runtime::arq::seq (16-bit RTP sequence numbers, RFC 3550 §5.1) and srt-runtime::arq::seq (31-bit SRT packet sequence numbers, draft-sharabayko-srt-01 §3.1): the two crates carried the same algorithm over different moduli (audit r08-RIST-O1, #1141). Circular over the space; of the two directions between two numbers the shorter one decides “before”/“after”. This is implementation policy, not spec-cited — neither protocol specifies a comparison algorithm.

Structs§

SeqSpace
A modular sequence-number space of bits bits (1..=31).

Constants§

MAX_SEQ_BITS
Widest supported space: a signed i32 distance must fit, so 31 bits.