Skip to main content

validate

Function validate 

Source
pub fn validate(received: &[u8], parity: u8) -> bool
Expand description

Validates that a received codeword is pristine.

Returns true only if the codeword is entirely uncorrupted; for codewords longer than 255 bytes, this includes carrying no bytes beyond the full length recorded in the header, and the parity argument is ignored, since the header records the parity. A true result implies that decode succeeds. The converse does not hold: decode repairs correctable corruption and discards trailing bytes, so it accepts input that this function rejects.