Skip to main content

Module gs1

Module gs1 

Source
Expand description

GS1 application-identifier (AI) parsing.

A GS1 QR payload is a sequence of application-identifier/value pairs. Fixed- length AIs are concatenated directly; variable-length AIs are terminated by the GS separator byte (0x1D) which a QR decoder emits for FNC1 in GS1 mode (see bits.rs). This parser splits such a byte stream back into elements.

It ships with a curated table of the most common AIs plus the measure-measure families (310n369n). Unknown AIs are surfaced best-effort (2-digit id, value up to the next GS) so real-world data is never silently truncated; full coverage of all 200+ GS1 AIs is out of scope.

Structs§

Gs1Element
One application-identifier/value pair split out of a GS1 payload.
Gs1Result
A parsed GS1 payload: the recovered Gs1Elements plus the original bytes.