Skip to main content

encode

Function encode 

Source
pub fn encode(data: &[u8], k: usize, n: usize) -> Option<(usize, Vec<Vec<u8>>)>
Expand description

Encode data into n shards (k data + n − k parity). Returns the original byte length (for un-padding on decode) and the shards. None for a degenerate (k, n) (k == 0, n < k, or n > 256 — GF(2^8) has only 256 distinct nodes).