GS1 Syntax Dictionary: Linter reference
A reference to the AI component linter routines referred to by the GS1 Syntax Dictionary. Copyright (c) 2022-2024 GS1 AISBL.
Main Page

The GS1 Syntax Dictionary contains entries describing the composition of each Application Identifier (AI) in the GS1 system in terms of its concatenated components.

Each component may be associated with one or more "linters" whose task is to analyse the component and detect common errors using the information that is available to them.

This documentation describes the actions of the set of reference linters that are provided by GS1 for use with the Syntax Dictionary, which are available here:

https://ref.gs1.org/tools/gs1-barcode-syntax-resource/syntax-tests/implementation/

Remarks

For each target platform it is intended that the linters may be cross-compiled, wrapped with language-specific code that calls the native functions, transliterated, or otherwise made available.

For each linter, its general action is described and a detailed reference is provided in the form of annotated C language source.

If the functions are being transliterated then the resulting code should be cross checked by additionally porting the extensive unit tests provided in the reference linter source files.

Linter reference

 gs1syntaxdictionary.hThis header contains the declarations for the reference linter functions of type gs1_linter_t referred to in the GS1 Syntax Dictionary, as well as the list of all possible return codes with a description of the indicated error conditions
 couponcodeThe couponcode linter ensures that the data conforms to the original North American Coupon Code (NACC) specification, as carried in AI (8110)
 couponposofferThe couponposoffer linter ensures that the data conforms to the modernised North American positive offer file coupon code standard, as carried in AI (8112)
 cset39The cset39 linter ensures that the given data contains only characters within GS1 AI encodable character set 39 ("CSET 39")
 cset64The cset64 linter ensures that the given data contains only characters within the GS1 AI encodable character set 64 ("CSET 64")
 cset82The cset82 linter ensures that the given data contains only characters within the GS1 AI encodable character set 82 ("CSET 82")
 csetnumericThe csetnumeric linter ensures that the given data contains only digits
 csumThe csum linter ensures that the data has a valid numeric check digit
 csumalphaThe csumalpha linter ensures that the data has a valid alphanumeric check character pair
 hasnondigitThe hasnondigit linter ensures that the given data contains a non-digit character
 hhThe hh linter ensures that the given data is a meaningful hour number in a day
 hhmmThe hhmm linter ensures that the given data is meaningful time as hours and minutes, in HHMM format
 hyphenThe hyphen linter ensures that the given data contains only hyphens
 ibanThe iban linter ensures that the data conforms to the format required for an International Bank Account Number (IBAN) number
 importeridxThe importeridx linter ensures that the given data is a valid Importer Index, as included in a Facility ID or Machine ID used in the EU 2018/574 system
 iso3166The iso3166 linter ensures that the data represents a valid ISO 3166 "num-3" country code
 iso3166999The iso3166999 linter ensures that the data represents an ISO 3166 "num-3" country code, or the value "999"
 iso3166alpha2The iso3166alpha2 linter ensures that the data represents an ISO 3166 "alpha-2" country code
 iso3166listNot used
 iso4217The iso4217 linter ensures that the data is in the list of ISO 4217 three-digit currency codes
 iso5218The iso5218 linter ensures that the given data represents a ISO/IEC 5218 biological sex code, either "0" (not known), "1" (male), "2" (female) or "9" (not applicable)
 keyThe key linter checks whether an input starts with a GS1 Company Prefix ("GCP")
 latitudeThe latitude linter ensures that the given data represents the latitude component of a WGS84 coordinate expressed as a 10-digit number
 longitudeThe longitude linter ensures that the given data represents the longitude component of a WGS84 coordinate expressed as a 10-digit number
 mediatypeThe mediatype linter ensures that the data represents a valid AIDC media type
 mmThe mm linter ensures that the given data is a meaningful minute number in an hour
 mmoptssNot used
 nonzeroThe nonzero linter ensures that the given data has a non-zero value
 nozeroprefixThe nozeroprefix linter ensures that the given data does not start with a zero
 pcencThe pcenc linter ensures that the data has correct percent-encoding
 pieceoftotalThe pieceoftotal linter ensures that the data represents a meaningful piece of total, i.e. a concatenation of non-zero piece number follow by an equal-width, non-zero total number of pieces
 posinseqslashThe posinseqslash linter ensures that the data represents a meaningful position in a sequence in the format "`<pos>/<end>`"
 ssThe ss linter ensures that the given data is a meaningful second number in a minute
 windingThe winding linter ensures that the given data represents a meaningful Winding Direction on a roll, either "0" (face out), "1" (face in) or "9" (undefined)
 yesnoThe yesno linter ensures that the given data represents a meaningful boolean state, either "0" (no) or "1" (yes)
 yymmd0The yymmd0 linter ensures that the data represents a meaningful date, in YYMMDD format, additionally permitting YYMM00 format indicating an unspecified day
 yymmddThe yymmdd linter ensures that the data represents a meaningful date, in YYMMDD format
 yymmddhhNot used
 yyyymmd0The yyyymmd0 linter ensures that the data represents a meaningful date, in YYYYMMDD format, additionally permitting YYYYMM00 format indicating an unspecified day
 yyyymmddThe yyyymmdd linter ensures that the data represents a meaningful date, in YYYYMMDD format
 zeroThe zero linter ensures that the given data has a zero value