Skip to main content

bounded_bit_mutations

Function bounded_bit_mutations 

Source
pub fn bounded_bit_mutations(input: &[u8], limit: usize) -> Vec<Vec<u8>>
Expand description

Produces at most limit deterministic one-bit hostile mutations.

The explicit limit keeps decoder corpora bounded in CI and downstream tests.

Examples found in repository?
examples/hostile_inputs.rs (line 8)
5fn main() {
6    let canonical = b"NIPC";
7    let truncation_count = every_truncation(canonical).count();
8    let mutations = bounded_bit_mutations(canonical, canonical.len());
9    println!(
10        "{truncation_count} truncations, {} bit mutations, {} boundary lengths",
11        mutations.len(),
12        HOSTILE_U64_BOUNDARIES.len()
13    );
14}