19constexpr size_t kNetsBlobSize = 4 + 1 + 1 + kMaxNetworks * (kSsidMax + 1 + kPassMax + 1 + 4) + 4;
20constexpr size_t kPinBlobSize = 4 + 1 + 1 + kSaltLen + kHashLen + 4;
23std::array<uint8_t, kNetsBlobSize>
serialize_nets(
const NetworkList& list);
27std::array<uint8_t, kPinBlobSize>
serialize_pin(
const PinRecord& rec);
std::optional< NetworkList > deserialize_nets(std::span< const uint8_t > blob)
Parses a nets blob; empty on wrong length, magic, version, CRC, count, unterminated or invalid fields...
Definition blobs.cpp:41
std::optional< PinRecord > deserialize_pin(std::span< const uint8_t > blob)
Parses a pin blob; empty on wrong length, magic, version, CRC or set byte.
Definition blobs.cpp:74
std::array< uint8_t, kNetsBlobSize > serialize_nets(const NetworkList &list)
Packs the list into the nets blob.
Definition blobs.cpp:24
std::array< uint8_t, kPinBlobSize > serialize_pin(const PinRecord &rec)
Packs the PIN record into the pin blob.
Definition blobs.cpp:63
Fixed-capacity list of saved WiFi networks with recency-based eviction (pure C++20,...