Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
log.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <iostream>
5#include <vector>
6
21inline void write_bytes_to_stdout(const std::vector<uint8_t>& data)
22{
23 for (auto byte : data) {
24 // Safety: a byte and a char occupy one byte
25 std::cout.put(static_cast<char>(byte));
26 }
27}
28
35{
36 // Convert the uint64_t to a vector of bytes, since std::cout.put
37 // only accepts a single byte.
38 std::vector<uint8_t> bytes;
39 bytes.reserve(sizeof(uint64_t));
40
41 for (size_t i = 0; i < sizeof(uint64_t); ++i) {
42 bytes.push_back(static_cast<uint8_t>(value & 0xFF));
43 value >>= 8;
44 }
45
47}
void write_bytes_to_stdout(const std::vector< uint8_t > &data)
Writes raw bytes of the vector to stdout.
Definition log.hpp:21
void writeUint64AsRawBytesToStdout(uint64_t value)
Writes a uint64_t to stdout in little endian format.
Definition log.hpp:34
const std::vector< FF > data
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13