34 inline std::vector<std::uint8_t>
RandomVector(std::size_t size_in_bytes) {
35 std::vector<std::uint8_t> buffer(size_in_bytes);
36 std::random_device random_device(
"/dev/urandom");
37 for (
auto i = 0u; i < buffer.size();) {
40 if (i +
sizeof(std::uint32_t) <= buffer.size()) {
41 auto u32_ptr =
reinterpret_cast<std::uint32_t*
>(buffer.data());
42 u32_ptr[i /
sizeof(std::uint32_t)] = random_device();
44 auto r = random_device();
45 auto bytes_left = buffer.size() - i;
46 assert(bytes_left <
sizeof(std::uint32_t));
47 std::copy(&r, &r + bytes_left, buffer.data() + i);
49 i +=
sizeof(std::uint32_t);
50 }
catch (std::exception& e) {