Expand description
The canonical member-stream serialization the reference.json
vectors and the C ABI surface (ffi) are defined over.
§Wire format
Every integer is big-endian. The stream a member-emitting FFI call hands out is exactly:
member_countasu32;- per member, in central-directory order:
name_lenasu32, followed by the member name as UTF-8 bytes (the reader refuses non-UTF-8 names atZipArchive::new, so the name is always valid);methodasu16(0stored,8DEFLATE);data_descriptoras one byte,0or1;compressed_sizeasu64;uncompressed_sizeasu64;crc32asu32;content_lenasu64, followed by exactly that many bytes of the extracted member content (CRC-verified by extraction).
The per-member sha256 digests in reference.json cover the
content bytes alone; the member-emitting FFI operation returns the
whole stream, so the language SDKs re-derive every recorded field
from one buffer.
This module is the single definition of that format: the vector
generator (tools/gen-reference) serializes its own records and
shares no code with the runtime, so nothing was moved here — the
generator stays untouched and the SDK-facing contract lives only in
this file.
Functions§
- member_
bytes - Serializes one member — its central-directory facts plus the
extracted
content— into the canonical stream fragment (see the module docs for the exact layout). - members_
stream - Serializes a whole parsed archive into the canonical byte stream the
language SDKs receive: the
u32member count followed by every member in central-directory order, each extracted and CRC-verified.