MCPcopy Create free account
hub / github.com/apache/datafusion / random_binary

Function random_binary

test-utils/src/array_gen/binary.rs:87–94  ·  view source on GitHub ↗

Return a binary vector of random bytes of length 1..=max_len

(rng: &mut StdRng, max_len: usize)

Source from the content-addressed store, hash-verified

85
86/// Return a binary vector of random bytes of length 1..=max_len
87fn random_binary(rng: &mut StdRng, max_len: usize) -> Vec<u8> {
88 if max_len == 0 {
89 Vec::new()
90 } else {
91 let len = rng.random_range(1..=max_len);
92 (0..len).map(|_| rng.random()).collect()
93 }
94}

Callers 2

gen_dataMethod · 0.85
gen_binary_viewMethod · 0.85

Calls 3

newFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…