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

Function random_subslice

hail-fuzz/src/mutations.rs:298–302  ·  view source on GitHub ↗
(rng: &mut R, slice: &'a [u8])

Source from the content-addressed store, hash-verified

296}
297
298fn random_subslice<'a, R: Rng>(rng: &mut R, slice: &'a [u8]) -> &'a [u8] {
299 let start: usize = rng.gen_range(0..slice.len());
300 let end: usize = rng.gen_range(start..slice.len());
301 &slice[start..=end]
302}
303
304fn splice_input<R: Rng>(rng: &mut R, input: &mut Vec<u8>, offset: usize, other: &[u8]) {
305 if other.is_empty() {

Callers 1

apply_mutationFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected