1#ifndef CHROMIUM_IPFS_BYTE_VIEW_H
2#define CHROMIUM_IPFS_BYTE_VIEW_H
10using ByteView = span<ipfs::Byte const>;
14inline span<std::uint8_t const> as_octets(ByteView bytes) {
15 return {
reinterpret_cast<std::uint8_t const*
>(bytes.data()), bytes.size()};
17template <
class ContiguousBytes>
18inline ByteView as_bytes(ContiguousBytes
const& b) {
19 auto p =
reinterpret_cast<ipfs::Byte const*
>(b.data());
20 return ByteView{p, b.size()};