Skip to content

binary wire protocol in C++ with explicit layout control, endian-safe serialization & offset-based encoding for predictable message handling.

Notifications You must be signed in to change notification settings

beingamanforever/binary-protocol-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Protocol C++ Example

A minimal, professional, byte-level binary protocol implementation in C++.

Features

  • Fixed-layout wire format (24 bytes)
  • Explicit endianness, alignment, and validation
  • XOR checksum for payload integrity

Usage

  • make test — run unit tests
  • make visual — see byte-level visualization

Wire Format

[2] msg_type | [2] msg_len | [2] checksum | [8] order_id | [4] price | [4] quantity | [1] side | [1] padding

Files

  • protocol.h — protocol layout & constants
  • codec.h/cpp — encode/decode logic
  • endian.h — endian helpers
  • visualizer.* — byte-level visualization
  • tests.cpp — tests & demo

About

binary wire protocol in C++ with explicit layout control, endian-safe serialization & offset-based encoding for predictable message handling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published