GS1.DataStructure (gs1_barcode v0.1.2)
View SourceDecoded GS1 Data Structure, encapsulating AIs, type, prefix, and original input.
Summary
Functions
Retrieves the data value associated with a specific AI.
Returns nil if the AI is not present.
Returns the map of AI codes and their data values.
Returns the raw input of barcode.
Returns the FNC1 prefix binary (<<>> if none was found).
Checks if a specific Application Identifier (AI) code is present in the decoded data.
Creates a new DataStructure t/0 struct.
Returns barcode without FNC1 prefix.
Returns type of the barcode.
Types
@type barcode_type() :: :gs1_datamatrix | :gs1_qrcode | :gs1_ean | :gs1_128 | :unknown
GS1 barcode symbology type.
:gs1_datamatrix- GS1 DataMatrix (2D):gs1_qrcode- GS1 QR Code (2D):gs1_ean- GS1 EAN/UPC (1D/linear):gs1_128- GS1-128 (1D/linear, formerly UCC/EAN-128):unknown- unrecognized or missing symbology identifier
@type t() :: %GS1.DataStructure{ ais: %{required(String.t()) => String.t()}, content: String.t(), fnc1_prefix: String.t(), type: barcode_type() }
Decoded GS1 Data Structure.
Fields
content: input exactly as received, including prefix if exists.type: barcode type (e.g.,:gs1_datamatrix).ais: A map of AI code (string) => data (string).fnc1_prefix: The FNC1 prefix string (e.g.,"]d2"), or""if none was found.
Functions
Retrieves the data value associated with a specific AI.
Returns nil if the AI is not present.
Returns the map of AI codes and their data values.
Returns the raw input of barcode.
Returns the FNC1 prefix binary (<<>> if none was found).
Checks if a specific Application Identifier (AI) code is present in the decoded data.
Creates a new DataStructure t/0 struct.
The ais parameter is normalized to a map if a keyword list is provided.
Returns barcode without FNC1 prefix.
@spec type(t()) :: barcode_type()
Returns type of the barcode.