pub fn encode_length(length: usize, out: &mut Vec<u8>) -> Result<(), Error>Expand description
Encode one §3.2.1 length sequence (0..=1275) into out.
0..=251— one byte, the value itself.252..=1275— two bytes:first ∈ 252..=255withfirst ≡ length (mod 4)offset from 252, thensecond = (length - first) / 4, so that the §3.2.1 decodesecond * 4 + firstreproduceslength.
Errors when length > 1275 (R2: the two-byte form tops out at
255 * 4 + 255).