mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #6273
0f78b06e
Various improvements to the ZMQ JSON-RPC handling: (Lee Clagett)
This commit is contained in:
commit
820ab9fdea
12 changed files with 832 additions and 1029 deletions
|
@ -51,12 +51,22 @@ namespace epee
|
|||
template<std::size_t N>
|
||||
static std::array<char, N * 2> array(const std::array<std::uint8_t, N>& src) noexcept
|
||||
{
|
||||
std::array<char, N * 2> out{{}};
|
||||
std::array<char, N * 2> out;
|
||||
static_assert(N <= 128, "keep the stack size down");
|
||||
buffer_unchecked(out.data(), {src.data(), src.size()});
|
||||
return out;
|
||||
}
|
||||
|
||||
//! \return An array containing hex of `src`.
|
||||
template<typename T>
|
||||
static std::array<char, sizeof(T) * 2> array(const T& src) noexcept
|
||||
{
|
||||
std::array<char, sizeof(T) * 2> out;
|
||||
static_assert(sizeof(T) <= 128, "keep the stack size down");
|
||||
buffer_unchecked(out.data(), as_byte_span(src));
|
||||
return out;
|
||||
}
|
||||
|
||||
//! Append `src` as hex to `out`.
|
||||
static void buffer(std::ostream& out, const span<const std::uint8_t> src);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue