1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Generate some random data to send
=
# Create the Encoder, with an MTU of 1400 (common for Ethernet)
=
# Perform the encoding, and serialize to bytes for transmission
=
# Here we simulate losing 10 of the packets randomly. Normally, you would send them over
# (potentially lossy) network here.
# Erase 10 packets at random
=
# The Decoder MUST be constructed with the configuration of the Encoder.
# The configuration should be transmitted over a reliable channel
=
# Perform the decoding
= None
=
break
# Check that even though some of the data was lost we are able to reconstruct the original message
assert ==