DOC-1WORD, DOC-2WORD, and DOC-4WORD are structure Meta records that open a document by giving its total WORD count.

ItemValue
NameDOC-1WORD (spec document BIND DOC-1WORD)
TAG ID0x1C0L
Codec ID0x00001C00
Spec document0x00000000/codecs/0x00001C00/ (DECLARE target 1C00)
Section14 1110 (Meta), offset within section C = 0
KindMeta · class: structure
TAG WORD0001 1100 0000 LLLL (000K KKKC CCCC LLLL)
Index descriptionDocument start whose total length is given in a Payload of 1 WORD
Hugo sidemeta/structure/doc.md (that page also covers DOC-2WORD and DOC-4WORD)

Fields (spec document)

The order of FIELDs within the document is the order of Payload fields (Codec spec document).

OrderField (BIND)FIELDWidthAccepted form (CODEC)ENUM
1count#2raw value 1 WORD

A record that opens the document. It specifies the total WORD count of the document in the Payload. DOC-1WORD (0x1C0L), DOC-2WORD (0x1C1L), and DOC-4WORD (0x1C2L) are covered together on this page.

Layout

TAG WORD          0001 1100 0000 LLLL      Codec 0x1C0L
[Length extension TAG]
Payload           Total WORD count. The Codec sets the width: DOC-1WORD 1, DOC-2WORD 2, DOC-4WORD 4
  • Codec: Meta 0x1C0L~0x1C2L, structure class
  • Payload: raw value (total WORD count of the document, unsigned)
  • Count: one per document, at the very beginning

Interpretation and validity

  • The length runs from the start of the opening record to the end of END.
  • Use the narrowest width that holds the value. Encoding with a wider width is rejected as a non-canonical encoding.
  • The length must equal the whole input. One document is one input.
  • A decoder can skip the whole document using this length. No Codec opens a document without knowing its length.
  • When computing the content hash, rewrite the length and its matching width with the verification-class Meta removed (content hash).

Example

  • 0x1C01 0x0017: DOC-1WORD, 23 WORD in total

Spec document source

The spec document 0x00000000/codecs/0x00001C00/latest.geul as read with geul show (hex in uppercase).

SPEC-VERSION 0x0001
DOC-ID 0x04260000000000001C0000000000
BODY
#1 DECLARE 0x1C00
#2 FIELD #1 0x0001
#3 BIND #1 "DOC-1WORD"
#4 BIND #2 "count"