Struct reed_solomon::Encoder
[−]
[src]
pub struct Encoder { /* fields omitted */ }
Reed-Solomon BCH encoder
Methods
impl Encoder
[src]
fn new(ecc_len: usize) -> Self
Constructs a new Encoder
and calculates generator polynomial of given ecc_len
.
Example
use reed_solomon::Encoder; let encoder = Encoder::new(8);Run
fn encode(&self, data: &[u8]) -> Buffer
Encodes passed &[u8]
slice and returns Buffer
with result and ecc
offset.
Example
use reed_solomon::Encoder; let data = "Hello World".as_bytes(); let encoder = Encoder::new(8); let encoded = encoder.encode(&data); println!("whole: {:?}", &encoded[..]); println!("data: {:?}", encoded.data()); println!("ecc: {:?}", encoded.ecc());Run