Skip to content
Snippets Groups Projects
Unverified Commit a3345a88 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

shuffle the shards before recoding

parent ace8b364
No related branches found
No related tags found
No related merge requests found
...@@ -203,6 +203,7 @@ where ...@@ -203,6 +203,7 @@ where
// recode a new random shard // recode a new random shard
let coeffs: Vec<F> = (0..nb_shards_to_recode).map(|_| F::rand(rng)).collect(); let coeffs: Vec<F> = (0..nb_shards_to_recode).map(|_| F::rand(rng)).collect();
shards.shuffle(rng);
let s: Vec<_> = shards.iter().take(nb_shards_to_recode).cloned().collect(); let s: Vec<_> = shards.iter().take(nb_shards_to_recode).cloned().collect();
let new_shard = fec::recode_with_coeffs(&s, &coeffs).unwrap(); let new_shard = fec::recode_with_coeffs(&s, &coeffs).unwrap();
shards.push(new_shard); shards.push(new_shard);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment