OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine/random_bytes.cpp

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

#include <eagine/main.hpp>
#include <eagine/span.hpp>
#include <iostream>
#include <vector>
namespace eagine {
//------------------------------------------------------------------------------
auto main(main_ctx&) -> int {
using namespace eagine;
std::vector<byte> bytes(256);
fill_with_random_bytes(cover(bytes));
std::cout << hexdump(view(bytes)) << std::endl;
return 0;
}
//------------------------------------------------------------------------------
} // namespace eagine
Common code is placed in this namespace.
Definition: eagine.hpp:21
static constexpr auto cover(T *addr, S size) noexcept -> span_if_mutable< T >
Creates a span starting at the specified pointer and specified length.
Definition: span.hpp:465
static constexpr auto view(T *addr, S size) noexcept -> const_span< T >
Creates a view starting at the specified pointer and specified length.
Definition: span.hpp:458
Class for encoding byte blocks into hexdump-like format.
Definition: hexdump.hpp:29

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).