Skip to main content

encode_shards

Function encode_shards 

Source
pub fn encode_shards(
    data: &[u8],
    data_shards: u8,
    parity_shards: u8,
    hmac_key: &[u8],
) -> Result<Vec<Shard>, CorrectionError>
Expand description

Encode data into Reed-Solomon shards with HMAC tags.

ยงErrors

Returns CorrectionError::InvalidParameters if shard counts are invalid, or CorrectionError::ReedSolomonError if encoding fails.