9#include <small_vector/SmallVector.h>
13 using ByteVector = llvm_vecsmall::SmallVector<uint8_t, 8>;
18 template <
typename T,
unsigned N>
19 struct hash<llvm_vecsmall::SmallVector<T, N>>
21 size_t operator()(
const llvm_vecsmall::SmallVector<T, N>& v)
const
24 0x7720796f726c694b, 0x2165726568207361};
25 return ccf::siphash::siphash<2, 4>(v.data(), v.size(), k);
32struct formatter<
ccf::ByteVector>
34 template <
typename ParseContext>
35 constexpr auto parse(ParseContext& ctx)
40 template <
typename FormatContext>
44 auto printable = [](uint8_t b) {
return b >= 0x20 && b <= 0x7e; };
45 if (std::all_of(e.begin(), e.end(), printable))
49 "<uint8[{}]: ascii={}>",
51 std::string(e.begin(), e.end()));
56 ctx.out(),
"<uint8[{}]: hex={:02x}>", e.size(), fmt::join(e,
" "));
uint64_t[2] SipKey
Definition siphash.h:13
Definition app_interface.h:15
llvm_vecsmall::SmallVector< uint8_t, 8 > ByteVector
Definition byte_vector.h:13
size_t operator()(const llvm_vecsmall::SmallVector< T, N > &v) const
Definition byte_vector.h:21