Skip to main content

ps_ecc/reed_solomon/
constants.rs

1/// Maximum error-correction capability of a Reed-Solomon codec.
2///
3/// A codec can correct at most 63 byte errors per codeword, which costs
4/// 126 parity bytes: two per correctable error.
5///
6/// Using parity values greater than 63 is impractical in GF(256) Reed-Solomon
7/// codes, as it would more than double the data size. If redundancy beyond 2x
8/// is required, consider combining RS codes with replication for data storage
9/// or retransmission for data transfer.
10pub const MAX_PARITY: u8 = 63;
11
12/// Maximum parity byte count, equal to `MAX_PARITY * 2`.
13pub const MAX_PARITY_BYTES: u8 = MAX_PARITY * 2;