storj.io/uplink@v1.13.0/private/eestream/fec.go (about) 1 // Copyright (C) 2023 Storj Labs, Inc. 2 // See LICENSE for copying information. 3 4 package eestream 5 6 import "storj.io/infectious" 7 8 // A Share represents a piece of the FEC-encoded data. 9 type Share = infectious.Share 10 11 // NewFEC creates a *FEC using k required pieces and n total pieces. 12 // Encoding data with this *FEC will generate n pieces, and decoding 13 // data requires k uncorrupted pieces. During decode, when more than 14 // k pieces exist, corrupted data can be detected and recovered from. 15 func NewFEC(k, n int) (*infectious.FEC, error) { 16 return infectious.NewFEC(k, n) 17 }