10#include <small_vector/SmallVector.h>
14 using ByteVector = llvm_vecsmall::SmallVector<uint8_t, 8>;
19 template <
typename T,
unsigned N>
20 struct hash<llvm_vecsmall::SmallVector<T, N>>
22 size_t operator()(
const llvm_vecsmall::SmallVector<T, N>& v)
const
25 0x7720796f726c694b, 0x2165726568207361};
26 return ccf::siphash::siphash<2, 4>(v.data(), v.size(), k);
33struct formatter<
ccf::ByteVector>
35 template <
typename ParseContext>
36 constexpr auto parse(ParseContext& ctx)
41 template <
typename FormatContext>
45 auto printable = [](uint8_t b) {
return b >= 0x20 && b <= 0x7e; };
46 if (std::all_of(e.begin(), e.end(), printable))
50 "<uint8[{}]: ascii={}>",
52 std::string(e.begin(), e.end()));
57 ctx.out(),
"<uint8[{}]: hex={:02x}>", e.size(), fmt::join(e,
" "));
uint64_t[2] SipKey
Definition siphash.h:13
Definition app_interface.h:14
llvm_vecsmall::SmallVector< uint8_t, 8 > ByteVector
Definition byte_vector.h:14
size_t operator()(const llvm_vecsmall::SmallVector< T, N > &v) const
Definition byte_vector.h:22