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

Function random_bytes

hail-fuzz/src/utils.rs:44–48  ·  view source on GitHub ↗

Fill `buf` with random bytes.

(rng: &mut R, buf: &mut Vec<u8>)

Source from the content-addressed store, hash-verified

42
43/// Fill `buf` with random bytes.
44pub(crate) fn random_bytes<R: Rng>(rng: &mut R, buf: &mut Vec<u8>) {
45 let len: usize = rng.gen_range(1..RANDOM_MAX);
46 buf.truncate(0);
47 buf.resize_with(len, || rng.gen())
48}
49
50/// Replace all bytes in the slice different values.
51pub fn randomize_input<R: Rng>(rng: &mut R, input: &mut MultiStream) {

Callers 2

random_inputFunction · 0.85
havoc_bytesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected