Function encode

Source
pub fn encode<H: Hasher>(
    total: u16,
    min: u16,
    data: Vec<u8>,
) -> Result<(H::Digest, Vec<Chunk<H>>), Error>
Expand description

Encode data using a Reed-Solomon coder and insert it into a bmt.

§Parameters

  • total: The total number of chunks to generate.
  • min: The minimum number of chunks required to decode the data.
  • data: The data to encode.

§Returns

  • root: The root of the bmt.
  • chunks: Chunks of encoded data (that can be proven against root).