Skip to main content

Module encode

Module encode 

Source
Expand description

src/headers/encode.rs

Header encoding utilities.

Design notes:

  • Serializes HeaderV1 into a fixed 80‑byte buffer in little‑endian order.
  • Field order must match types.rs layout exactly for ABI stability.
  • Validation is performed before encoding to fail fast on invalid headers.
  • Returns a fixed [u8; HEADER_LEN_V1] buffer on success.

Functions§

encode_header_le
Serialize a HeaderV1 into an 80‑byte buffer in little‑endian order.