Skip to main content

Module file_format

Module file_format 

Source
Expand description

VSF file format with headers and hierarchical fields

Binary structure (authoritative order; see VsfHeader::decode):

RÅ<                                    Magic + header start z[version]                           Version number y[backward_compat]                   Backward compatibility version b[header_len]                         Header length in BYTES l[file_len]?                         Optional total file/wire length e[creation_time]?                    Optional creation timestamp (eu6 default, ef5/ef6 legacy) hp[32B]                              Provenance hash (BLAKE3) — REQUIRED (ke[pubkey] ge[sig] | hb[hash])?           Signature (pubkey + sig) OR rolling integrity hash, mutually exclusive n[field_count]                       Number of header field definitions

  (d[section_name] h?[hash] g?[sig] k?[key] o[offset] b[size] n[count])  Header field (section pointer) ...
>                                      Header end

[                                      Section start (if n > 0) d[section_name]                      Section name (d[field_name]:[value])              Field definition (leaf) (d[field_name] o[offset] b[size] n[count])  Nested section (branch) ... ]                                      Section end

[raw_bytes...]                         Unboxed data (if n = 0)

Structs§

HeaderField
Header field definition (section pointer with positional values) Format: (d[section_name] o[offset] b[size] n[count]) Note: Header fields use POSITIONAL values (no colons or commas) For inline fields (no section body): (d[name]:value,value,…)
VsfField
Single field in a section
VsfHeader
VSF file header
VsfSection
Section of structured data (has children)

Functions§

validate_name
Validate VSF section or field name