pub fn encode(message: &[u8], parity: u8) -> Result<Buffer, EncodeError>Expand description
Encodes a message by adding an error-correcting code.
Messages longer than 255 - 2 * parity bytes are encoded in the long ECC
format; all other messages become a single Reed-Solomon codeword.
ยงErrors
For messages that fit a single codeword:
RSConstructorErroris returned ifparityexceedscrate::MAX_PARITY.RSEncodeErroris returned if encoding fails.
For longer messages:
LongEccEncodeErroris returned if long encoding fails.