MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / random_stride

Function random_stride

hail-fuzz/src/utils.rs:82–94  ·  view source on GitHub ↗
(rng: &mut R, stride_bitmask: u8)

Source from the content-addressed store, hash-verified

80];
81
82pub fn random_stride<R: Rng>(rng: &mut R, stride_bitmask: u8) -> usize {
83 let choices: &[usize] = match stride_bitmask {
84 7 => &[1, 2, 4],
85 6 => &[2, 4],
86 5 => &[1, 4],
87 4 => &[4],
88 3 => &[1, 2],
89 2 => &[2],
90 1 => &[1],
91 _ => &[1],
92 };
93 *choices.choose(rng).unwrap_or(&1)
94}
95
96/// Generate a random range between `start..=end` with a maximum size of `max_size`.
97pub fn rand_range<R: Rng>(

Callers 2

extend_input_byFunction · 0.85
apply_mutationFunction · 0.85

Calls 1

chooseMethod · 0.80

Tested by

no test coverage detected