A lightweight, header-only C++23 library for safe binary data streaming and serialization, primarily for network protocols.
Hexi is a header-only C++ library for binary data streaming and serialization, focusing on network protocol handling. It provides a safe, lightweight alternative to manual byte copying or heavy serialization frameworks, with built-in bounds checking and endianness support.
C++ developers working with network protocols, binary data formats, or embedded systems who need efficient, portable serialization without the overhead of larger libraries.
Hexi offers a minimal, safety-first design with zero dependencies, compile-time optimizations, and flexibility for custom containers, making it ideal for performance-sensitive applications where control and reliability are critical.
Header-only, lightweight C++ library for binary streaming & serialization. Network data handling made easy peasy!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Zero dependencies and a single header file make integration trivial, suitable for embedded or performance-critical systems, as highlighted in the Key Features.
Prevents buffer overruns with compile-time or runtime checks, ensuring safe handling of untrusted network data, a core design goal mentioned in the README.
Built-in endian conversion with no runtime overhead when native order matches, enabling portable code without performance penalties, as explained in the endian handling section.
Supports exceptions or compile-time no_throw mode for zero-overhead error management, giving developers control based on their use case, detailed in the error handling examples.
Works with standard containers and allows custom non-contiguous ones, like static_buffer and dynamic_buffer, providing flexibility for various buffer types.
Users must define serialization operators for custom types, which can be verbose and error-prone for complex data structures, unlike more automated libraries.
The README explicitly states Hexi lacks features for schema changes or data versioning, requiring manual updates when protocols evolve.
Requires modern C++ standards, which may not be supported in legacy projects or with older compilers, limiting adoption in some environments.
Polymorphic streams (pmc::) introduce virtual call overhead, as noted in the README, which can impact performance in latency-sensitive applications.