跳到主要内容

7 AIDC validation rules

7.1 Introduction

The purpose of entering data transmitted from a reading device into a system is to record a transaction. In the GS1 system, a transaction is an Electronic Message to be processed according to the meaning and content of the data fields contained in the message. This should be possible without requiring any human intervention to determine the data’s meaning and content.

First, an item must be physically present in order to produce a barcode or RFID reader message about the item. Only the data present in the data carrier on the item, and therefore relevant to it, can be recorded.

The standardised element strings of the GS1 system are the basis for the identification of items of every kind. They identify a particular item in an unambiguous manner and supply relevant attribute information.

When these element strings are printed on items, the scanned and transmitted data refers to that item and identifies its physical presence at a given location. When the message read from the scanned data carrier is coupled with an internally assigned designation of the type of item movement (e.g., warehouse entry, stock taking, sales), it is possible to automatically record data related to each movement of items. This provides security in two ways. First, an item must be physically present in order to produce a barcode reader message about the item, and second, only the data in the barcode on the item and, therefore, relevant to it, can be recorded. False notification of movements is thereby largely eliminated.

When element strings are used in administrative areas (e.g., in order entry) they also can be used for automatic, error-free data capture. Because of the considerable length of many GS1 system ID numbers, automatic reading has great significance. By using a check digit, a digit that ensures the data has been correctly composed, the accuracy of the reading is verified.

7.2 Synopsis of message processing

Figure 7-1 Synopsis of element string message processing

For details on any of the actions in Figure 7-1, see the following subsections. Note: For message processing using the GS1 Digital Link URI syntax see the GS1 Digital Link standard for detailed information

7.2.1 Analysis of the data carrier and plausibility test for element strings

Figure 7-2 Test procedure (1) GS1 symbologies that encode data using GS1 Application Identifiers include GS1-128, GS1 DataMatrix, GS1 QR Code, GS1 DotCode, GS1 DataBar and Composite and are shown in 7.8. For further details on any of the actions in Figure 7-2, see the sections 7.2.2, 7.2.3, 7.2.4, 7.2.5, 7.2.6, 7.2.7 and 7.2.8.

(2) For QR Code and Data Matrix symbologies encoding the GS1 Digital Link URI syntax see the GS1 Digital Link standard for detailed information

7.2.2 Symbology identification

Each transmitted full string consists of a symbology identifier and one or more element strings (see section 3). The identifiers of barcode symbologies are stated in section 5.

7.2.3 Prefix in internal table

System users may generate an internal table showing the GS1 Prefixes of element strings they wish to process. This table also serves to sort out the element strings representing item identification numbers in order to check their presence in the data file. Details on the respective prefixes are stated in section 3.

7.2.4 Item Identification

The symbols in the EAN/UPC symbology family contain identification data for trade items and special data structures (e.g., coupons). Whether an element string contains the identification of a trade item is determined by the GS1 Prefix. System users must determine the specific structure and meaning of prefixes 20 to 29 as defined by their GS1 Member Organisation.

7.2.5 GS1 Application Identifier (AI) in internal table

The element strings using GS1 Application Identifiers cover a wide range of applications. In order to keep the amount of programming on a reasonable level, it is possible to ignore processing of unwanted element strings. This is achieved by establishing an internal table with only the GS1 Application Identifiers intended for processing.

7.2.6 Length of data 14 Digits

ITF-14 barcodes are used to represent trade item identification numbers. As the use of the general ITF symbology is not exclusive to the GS1 system a check to ensure the symbol encodes 14-digit reference field is recommended.

7.2.7 Check digit calculation and other system checks

In EAN/UPC symbology, the check digit verifies reading and decoding of barcodes as well as Global Trade Item Numbers (GTINs). This is performed automatically by the barcode reader. Barcode readers processing ITF-14 symbols may be programmed to verify the GTIN’s check digit as well. If this recommended verification has been performed, it is indicated by the symbology identifier ]I1 (see section 5). For data transmitted from ITF-14 symbols with symbology identifier ]I0, the GTIN’s check digit SHALL be verified separately.

GS1-128 and GS1 DataBar have an integral symbol check character that verifies correct decoding of scanned data while GS1 DataMatrix, GS1 QR Code and GS1 DotCode have a Reed Solomon error checking and correction feature. If an element string encoded in one of these symbol types includes a check digit, the check digit will not normally be verified by the barcode reader and SHALL be verified separately. While the data security provided by the symbol check character or error checking guarantees proper decoding of the entire element string, correctness of the contained identification number is achieved by having the application software verify the ID number’s check digit. Other logical tests checks are recommended for reasonable data content, such as verifying:

Data field ranges (e.g., month < 13 and > 00).

  • The maximum length of a variable length element string.

  • No alphanumeric characters in numeric only fields.

  • Correct GS1 Prefixes.

7.2.8 Move element string to message field

Several element strings may be scanned in a single transaction. In order to verify the correctness and completeness of the transmitted data, each element string is transferred to a message record.

If an element string does not include a GS1 Application Identifier, verification of the message is simplified if a GS1 Application Identifier is internally assigned. Global Trade Item Numbers (GTINs) that are carried by EAN-13, UPC-A, UPC-E or ITF-14 barcodes may be denoted with an internally assigned AI (01). Other element strings may be assigned "ghost" GS1 Application Identifiers.

7.3 Validation of the electronic message regarding system consistency

The GS1 system enables system users to process scanned data without human intervention. This implies that the electronic message generated from data scanned and transmitted from data carriers needs to substitute for all human activities during a particular transaction. In other words, the transmitted data must provide all information required for its correct processing.

The GS1 system is designed to fulfil these requirements. Section 4 describes the association of element strings to form valid messages. Validation of system consistency refers to the verification of the correct composition of the electronic message by a system processing the transaction messages. Whether the message is adequate in business application terms is dealt with by the application software.

Only messages containing a valid set of element strings defined in the GS1 system can be unambiguously processed. The processing of invalid messages may lead to data file errors because the meaning and relationship of the element strings are not defined. This is illustrated in Table 7-1 and Table 7-2.

Table 7-1 Examples of valid messages

Element strings in messageComment
AI 00AI 33nnIdentification of a logistic unit + logistic weight
AI 00AI 01Identification of an entity as a logistic unit and as a fixed measure trade item
AI 00AI 01 withN1 =9'AI 31nnIdentification of an entity as a logistic unit and as a variable measure trade item
AI 00AI 02AI 37Identification of a logistic unit and its contained fixed measure trade items
AI 01AI 10AI 15Identification of a trade item + lot number + best before date
AI 00AI 401Identification of a logistic unit as part of a consignment
AI 01 '9'AI 31nnAI 33nnIdentification of a variable measure trade item + logistic weight
AI 00AI 01AI 33nnIdentification of an entity as a logistic unit and a fixed measure trade item; the logistic weight is associated with the identification number of the logistic unit
AI 01AI 710Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 711Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 712Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 713Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 714Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 715Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 716Identification of a trade item + National Healthcare Reimbursement Number
AI 01AI 717Identification of a trade item + National Healthcare Reimbursement Number

Table 7-2 Examples of invalid messages

Element strings in messageComment
AI 00AI 01AI 37Invalid identification of an entity as a logistic unit and as a fixed measure trade item; AI 37 (quantity of items contained) must be used with AI 02 only
AI 01AI 10AI 33nnInvalid identification of a fixed measure trade item + lot number; AI 33nn is incorrect because logistic measures of a fixed measure trade item are fixed attributes stored in the data file
AI 01'9'AI 33nnInvalid identification of a variable measure trade item + logistic weight; the mandatory element string with a trade measure is missing
AI 00AI 11Invalid identification of a logistic unit; AI 11 is incorrect because a production date must be associated with the identification number of a trade item
AI 00AI 01AI 02/37Invalid identification of an entity as a logistic unit and as a fixed measure trade item; AI 02/37 must not be associated with AI 01
AI 01AI 30Invalid identification of a fixed measure trade item; AI 30 must only be associated with the identification number of a variable measure trade item
Element strings in messageComment
AI 02AI 37Invalid identification of the fixed measure trade units contained in an unidentified logistic unit; AI 00 is missing
AI 00AI 02Invalid identification of a logistic unit and of the contained fixed measure trade items; AI 02 requires the mandatory presence of AI 37 to complete the identification of the content

7.4 Validation of the electronic message regarding user requirements

Some industry groups and organisations specify the use of particular element strings for attributes and other information not directly identifying the item. Contrary to the validation of messages for system conformity, GS1 does not define the rules for the validation and application of these particular element strings. Validation of messages containing these element strings in these environments (e.g., trade item identification with best before date and batch number) is left to the discretion of the particular system user community.

Validation of the correctness of a message may be performed differently for each Global Trade Item Number (GTIN) and instructions must be stored in the data file. System users should include the GS1 Application Identifiers and their specific application rules in the stored instructions.

Validation of the user requirements must be performed after validation of system consistency. Missing elements in consistent messages may be by-passed or completed in given instances.

Inconsistent messages can never be processed properly.

7.5 Conversion of weights and measures in user applications

All weights and measures that are encoded in the element strings with the GS1 Application Identifiers (31nn) to (36nn) are structured according to the same mathematical rules. The determination of basic units of measurement and the freedom to choose the number of decimal positions will lead to variations in data representation. Suppliers will choose the value that best suits the respective trade item in terms of weight/size and the degree of accuracy required (e.g., grams) for the representation of weights and measures in the six-position data field.

The recipient of such goods also may want to store these details in a standardised form in his data file. This requirement is easily fulfilled through programming with the conversion formula shown below.

As described in section 3, in the GS1 Application Identifier position A4 denotes the position of the implied decimal point, called the inverse exponent. The three-step formula to convert weights and measures is as follows:

  1. Define the company's internal inverse exponent in accordance with the basic unit of measure of the company's internal field structure (e.g., for an AI expressing weight in kilograms, inverse exponent 0 could signify kilograms and inverse exponent 3 could signify grams).

  2. Subtract the company's internal inverse exponent from the value of the position A4 of the GS1 Application Identifier in the decoded element string. Call the result X. 3. Divide the amount of the six-digit applicable value field from the decoded data string by 10x.

The result is the value required in the company's data structure. In the examples in Table 7-3, the company's system uses internal weight fields eight digits in length (format: nnnnnnn.n) with a unit of measure equal to grams. Thus, the company uses the internal inverse exponent of 3.

Table 7-3 Conversion examples

Decoded data stringConversionInternal weight field
GS1WeightWeightEight-digit data field defined as grams with one decimal positionEight-digit data field defined as grams
Applicationwith one decimal position
Identifier
A1 A2 A3 A4
31000005097 (= 5097 kg)Step 2: X = 0 minus 3 = -3 Step 3: 005097 divided by 10-3 (.001) =5097000
Decoded data stringConversionInternal weight field
3102005097 (= 50.97 kg)Step 2: X = 2 minus 3 = -1 Step 3: 005097 divided by 10-1 (.1) =0050970
3103045250 (= 45.250 kg)Step 2: X = 3 minus 3 = 0 Step 3: 045250 divided by 100 (1) =0045250
3104012347 (= 1234.7 g)Step 2: X = 4 minus 3 = 1 Step 3: 012347 divided by 101 (10) =0001234 7

Decimal point In the examples in Table 7-4, the company’s system uses internal weight fields eight digits in length (format: nnnnn.nnn) with a unit of measure equal to kilograms. Thus the company uses an internal inverse exponent of 0

Table 7-4 Conversion examples

Decoded data stringConversionInternal weight field
GS1WeightEight-digit data field defined as kilograms
Applicationwith three decimal position
Identifier
A1 A2 A3 A4
3100005097 (= 5097 kg)Step 2: X = 0 minus 0 = 0 Step 3: 005097 divided by 100 (1) =05097
3102005097 (= 50.97 kg)Step 2: X = 2 minus 0 = 2 Step 3: 005097 divided by 102 (100) =00050 97
3103045250 (= 45.250 kg)Step 2: X = 3 minus 0 = 3 Step 3: 045250 divided by 103 (1000) =00045 25
3104012347 (= 1234.7 g)Step 2: X = 4 minus 0 = 4 Step 3: 012347 divided by 104 (10000) =00001 235
Decimal pointPosition rounded

7.6 Linkage of GTINs in a database

A trade item is any item (product or service) upon which there is a need to retrieve predefined information and that may be priced, or ordered, or invoiced at any point in any supply chain. Trade items may be a single item, part, unit, product, or service, or a predefined multiple or grouping or combination of such items. A separate Global Trade Item Number (GTIN) identifies each of these items unambiguously, irrespective of the applied data structure. This also applies to identification numbers for restricted distribution in a closed environment.

Information about the hierarchical structure of trade items is an important issue in a business. Section 7.6.1 illustrates an example of how the required links can be established by using a relational database.

7.6.1 The principle

The hierarchy for the example in Figure 7-3 is basic product = A; 10 x A = product B; 5 x B = product C.

Figure 7-3 Example of GTIN linkage in database

See Figure 7-4 for the mechanism of linkage for the various types of trade items.

7.6.2 Extended example of a trade item hierarchy

Figure 7-4 Extended example of trade item hierarchy

Note: For reasons of simplicity, Global Trade Item Numbers (GTINs) are expressed in letters in this example, signifying that they may be of any standardised structure.

Figure 7-5 Example of GTIN linkage in database

  • Quantity of items numbered A contained in item C Note: The columns "GTIN in database" and "GTIN of relation" are sufficient to establish the links between the different items. The column "Quantity of items contained" provides additional information, which may be useful in particular business applications. The column "Relation is mixed trade item" provides the relations pointing to all trade items contained in a mixed trade item.

7.6.3 Linkage of GTINs in a non-relational database by trade item manufacturer

Many types of items are produced and distributed in fixed measure nested packaging configurations (e.g., consumer unit, carton, case, pallet) with fixed quantity relationships. The various packaging configurations are often broken into lower levels at various points in the supply chain and, therefore, each level of the packaging may be a trade item. Computer systems must be capable of understanding the relationships of the units or trade items in the configuration and treating inventory of all levels of the configuration as one SKU (stock keeping unit).

The first digit indicator (values 1 to 8) of the GTIN-14 data structure can be used to identify levels of a packaging configuration. This allows digits 2 to 13 to remain constant for all levels of the packaging configurations for an item. If this method of numbering item configurations is used when necessary to support business processes or when driven by system constraints, the non-relational database construct defined below may be appropriate.

The item database is constructed with a base item record (table) and segments (tables) for each level of the item packaging configuration. Properly designed, this type of system can support pricing, ordering and shipping of any level of the packaging configuration (trade item) with appropriate dimension and weight information. It enables inventories to be maintained by packaging level and in total for the base item. It also provides channel partners or customers the choice of ordering and invoicing units. Meeting these requirements often makes this approach a good business solution for manufacturers, because it meets the most critical needs in the supply chain and is practical to implement, particularly in distributed and small systems where performance is critical.

Using the GTIN-14 data structure, the base item record contains the base GTIN-8, GTIN-12, or GTIN-13 ID Number (digits 2 to 13) as a key, with all information relating to the base unit and the item in total (including total inventory balance). Each of the packaging segments contains information unique to the respective packaging configuration (e.g., indicator, check digit, quantity relationship to next lower level of the configuration, dimensions, weight, prices). After accessing the item record using the GTIN of the base item (digits 2 to 13), the packaging segments are accessed using the indicator (first digit). This construct demands that:

The trade item must be fixed in measure.

  • There must be a single Global Trade Item Number (GTIN) for the base item of the related

  • packaging configurations that is a GTIN-8, GTIN-12, or GTIN-13.

Each related packaging configuration is limited to eight levels of packaging for the base item using

  • indicator values 1 to 8.

When storing GTIN-8s, GTIN-12s, or GTIN-13s in a 14-digit reference field or 14-digit data carrier, they must be stored based on rules that ensure their uniqueness. Companies that receive trade items with GTINs must be able to process the complete GTIN without regard to how it was constructed.

7.7 Element strings represented in data carriers

Scanned element strings are decoded as a full string by the reading device and are then transmitted for processing in the application software. The full string is composed of a symbology identifier and one or more element strings. The meaning of an element string is also determined by the data carrier in which it is represented.

A synopsis by data carrier of the element strings described in these specifications is shown in Figure 7-6, which also provides an overview of the sequential number range of trade items by data carrier.

The element strings encoded in any GS1 symbology that uses GS1 Application Identifiers (such as GS1-128, GS1 DataMatrix, GS1 DataBar, GS1 QR Code, GS1 DotCode and GS1 Composite) are composed of one or more GS1 Application Identifiers and one or several data fields. The GS1 Application Identifier denotes the contents and structure of the respective data fields, see section 3.

section 7.8 provides more information on the data processing aspects.

ITF-14 or GS1-128 barcode EAN-13 barcode UPC-A or UPC-E barcode EAN-8 barcode
EAN-13 barcode UPC-A or UPC-E barcode EAN-8 barcode
UPC-A or UPC-E barcode EAN-8 barcode
EAN-8 barcode
*** * * *0 0 0 0 0 0 0 C 0 9 9 9 9 9 9 C
*** * * *1 0 0 0 0 0 0 C 1 3 9 9 9 9 9 C
*** * * *2 0 0 0 0 0 0 C 2 9 9 9 9 9 9 C
*** * * *3 0 0 0 0 0 0 C 9 6 9 9 9 9 9 C
0 00 00 0 0 1 0 0 0 0 0 0 0 C 0 0 0 9 9 9 9 9 9 9 9 C
**0 0 1 0 0 0 0 0 0 0 0 C 0 0 7 9 9 9 9 9 9 9 9 C
0 00 00 0 8 0 0 0 0 0 0 0 0 C 1 9 9 9 9 9 9 9 9 9 9 C
*0 02 0 0 0 0 0 0 0 0 0 0 C 2 9 9 9 9 9 9 9 9 9 9 C
0 00 03 0 0 0 0 0 0 0 0 0 0 C 3 9 9 9 9 9 9 9 9 9 9 C
*0 04 0 0 0 0 0 0 0 0 0 0 C 4 9 9 9 9 9 9 9 9 9 9 C
*0 05 0 0 0 0 0 0 0 0 0 0 C 5 9 9 9 9 9 9 9 9 9 9 C
0 00 06 0 0 0 0 0 0 0 0 0 0 C 9 9 9 9 9 9 9 9 9 9 9 C
0 01 0 0 0 0 0 0 0 0 0 0 0 C 1 3 9 9 9 9 9 9 9 9 9 9 C
* *2 0 0 0 0 0 0 0 0 0 0 0 C 2 9 9 9 9 9 9 9 9 9 9 9 C
0 03 0 0 0 0 0 0 0 0 0 0 0 C 9 6 9 9 9 9 9 9 9 9 9 9 C
*9 7 7 0 0 0 0 0 0 0 0 0 C 9 7 9 9 9 9 9 9 9 9 9 9 C
* *9 7 8 0 0 0 0 0 0 0 0 0 C 9 7 9 9 9 9 9 9 9 9 9 9 C
*9 8 0 0 0 0 0 0 0 0 0 0 C 9 8 2 9 9 9 9 9 9 9 9 9 C
*9 9 0 0 0 0 0 0 0 0 0 0 C 9 9 9 9 9 9 9 9 9 9 9 9 C
1 0 0 0 0 0 1 0 0 0 0 0 0 C 8 0 0 0 0 0 1 3 9 9 9 9 9 C
1 0 0 0 0 0 3 0 0 0 0 0 0 C 8 0 0 0 0 0 9 6 9 9 9 9 9 C
1 0 0 0 0 1 0 0 0 0 0 0 0 C 9 0 0 0 0 9 9 9 9 9 9 9 9 C
1 0 0 0 9 0 0 0 0 0 0 0 0 C 9 0 1 9 9 9 9 9 9 9 9 9 9 C
1 0 3 0 0 0 0 0 0 0 0 0 0 C 9 0 3 9 9 9 9 9 9 9 9 9 9 C
1 0 6 0 0 0 0 0 0 0 0 0 0 C 9 0 9 9 9 9 9 9 9 9 9 9 9 C
1 1 0 0 0 0 0 0 0 0 0 0 0 C 9 1 3 9 9 9 9 9 9 9 9 9 9 C
1 3 0 0 0 0 0 0 0 0 0 0 0 C 9 9 6 9 9 9 9 9 9 9 9 9 9 C 1 9 7 8 0 0 0 0 0 0 0 0 0 C 8 9 7 9 9 9 9 9 9 9 9 9 9 C
                                                1. Fixed measure; 2. Fixed measure restricted distribution; 3. Variable measure; 4. Variable measure restricted distribution (not a GTIN); 5. Coupons (not a GTIN); 6. Refund receipts (not a GTIN); 7. ISSN; 8. ISBN

Figure 7-6 Element strings by data carrier

7.8 Processing of data from a GS1 symbology using GS1 Application

Identifiers

Figure 7-7 Data processing overview

This system logic holds true for any GS1 symbology using GS1 Application Identifiers. The symbology identifiers listed in Figure 7-7 are: ]C1 = GS1-128.

  • ]e0 = GS1 DataBar and GS1 Composite symbols.

  • ]d2 = GS1 DataMatrix.

  • ]Q3 = GS1 QR Code.

  • ]J1 = GS1 DotCode.

7.8.1 General

Any GS1 symbology using GS1 Application Identifiers may represent several element strings in concatenated form (see section 5). For processing as shown in section 7.3, it is necessary to separate each element string, which is performed by the processing routine illustrated in Figure 7-7.

7.8.2 GS1 Application Identifier lengths

Assigned GS1 Application Identifiers have a defined length. Each GS1 Application Identifier is 2, 3 or 4 digits in length. Knowing these lengths can assist in processing data strings. When a GS1 Application Identifier is approved for application use, the length of the GS1 AI is defined. All GS1 AIs beginning with the same two lead digits SHALL have the same length. Table 7-5 provides the defined lengths of GS1 AIs based on the leading two digits.

Table 7-5 GS1 Application Identifier lengths

First 2GS1 AIFirst 2GS1 AIFirst 2GS1 AIFirst 2GS1 AIFirst 2GS1 AI
digitslengthdigitslengthdigitslengthdigitslengthdigitslength
002172334704942
012202344713952
022212354724962
032222364804972
102233372814982
112243394824992
122253403902
132302413912
152314423922
162324434932

7.8.3 Element strings with predefined lengths using GS1 Application Identifiers

Representation of more than one element string in a GS1 symbology using GS1 Application Identifiers may require the use of a separator character between the different element strings to mark their end.

However, in order to enable printing of smaller barcodes, some element strings have been predefined in length, so that their end is determined and a separator character SHOULD NOT be used. These element strings are shown in the predefined table in Table 7-6. All other element strings, even if defined as fixed length in section 3, are not of predefined length and are formally variable length fields which require a separator character if followed by another element string.

A separator character SHOULD NOT be used at the end of the last element string represented in a barcode or for certain AI combinations defined by the symbology specification (e.g., some types of GS1 DataBar).

7.8.4 The separator character and its value

In GS1-128 symbology: The Function 1 Symbol Character (FNC1) SHOULD be the separator character, and the control character (ASCII value 29 (decimal), 1D (hexadecimal)) may be an alternative.

In GS1 DataMatrix and GS1 DotCode symbology: The Function 1 Symbol Character (FNC1) or the control character SHALL be the separator character. In GS1 QR Code symbology: The control character or the character ‘%’ (ASCII value 37 (decimal), 25 (hexadecimal)) SHALL be the separator character.

In GS1 DataBar and GS1 Composite symbology: The Function 1 Symbol Character (FNC1) SHALL be the separator character. The value of the decoded separator character transmitted in the decoded data string is always control character (ASCII value 29 (decimal), 1D (hexadecimal)). It is important to note that some receiving systems may convert/interpret the control character as something other than ASCII value 29 (decimal), 1D (hexadecimal).

All element strings not included in the predefined table shown in Table 7-6 MUST be separated by a separator character when followed by another element string in a single barcode.

7.8.5 The basic structure of GS1 barcodes using GS1 Application Identifiers and

concatenation GS1 barcode symbologies that use GS1 Application Identifiers generally have a particular symbol character to indicate that the data is encoded according to the GS1 Application Identifier rules. For example, the GS1-128 symbology uses the Function 1 Symbol Character (FNC1) in the position immediately following the start character. This character pattern is reserved for GS1 system applications worldwide and makes it possible to distinguish GS1-128 barcodes from Code 128 symbols encoding non-GS1 data.

Start character A , B, or CFunction 1Element string(s)Symbol check characterStop character
Symbol
Character
(FNC1)
GS1 Application IdentifierData field

Figure 7-8 Example GS1-128 barcode structure

All GS1 barcode symbologies that use GS1 Application Identifiers allow several element strings to be encoded in one barcode, a process called concatenation. Concatenation is advantageous because it means that the symbol’s double start, symbol check and stop characters are only needed once and the space required for the symbol is smaller than when separate barcodes are used to encode each element string. It also improves scanning accuracy, allowing for single scanning rather than multiple scanning. The various element strings are transmitted from the barcode reader as a single full string.

The various element strings, which are transmitted from concatenated barcodes, have to be analysed and processed. All element strings need to be separated by a separator character unless they have a predefined length or appear at the end of the symbol (encoded immediately before the symbol check character). All predefined length element strings are contained in Table 7-6).

The separator character SHALL be either the Function 1 Symbol Character (FNC1), or the control character (ASCII value 29 (decimal), 1D (hexadecimal)), or, in the case of GS1 QR Code symbology, the control character or the character ‘%’ (ASCII value 37 (decimal), 25 (hexadecimal)). Table 7-6 contains all element strings that have a predefined length and, therefore, SHOULD NOT be terminated by a separator character.

Table 7-6 Element strings with predefined length using GS1 Application Identifiers

First two digits of the GS1Number of characters
Application Identifier(GS1 Application Identifier and data field)
0020
0116
0216
0316
(04)18
118
128
138
(14)8
158
168
178
(18)8
(19)8
204
3110
3210
3310
3410
3510
3610
4116

Note: Table 7-6 is limited to the listed numbers and will remain unchanged. Those numbers in parentheses are not yet assigned. GS1 Application Identifiers starting with two digits that are not included in Table 7-6 have a variable length even if the definition of the GS1 Application Identifier specifies a fixed length data field.

7.8.6 Concatenation

7.8.6.1 Predefined length element strings

Concatenated element strings constructed from GS1 Application Identifiers with a predefined length SHOULD NOT use a separator character following the element string of predefined length. Each element string is immediately followed by either the next GS1 Application Identifier or the symbol check character and stop character.

For example, concatenation of net weight (4.00 kilograms) with the associated Global Trade Item Number (GTIN) 95012345678903 SHOULD NOT include the use of a separator character. (01) has a predefined element string length of 16 digits.

  • (31nn) has a predefined element string length of 10 digits.

  • GTIN 95012345678903

Net weight 4.00 kg

Figure 7-9 Data encoded in two GS1-128 symbols

GTIN 95012345678903 Net weight 4.00 kg

Figure 7-10 Data encoded in one concatenated GS1-128 symbol

7.8.6.2 Non-predefined length element strings

An element string that does not start with two characters defined in Table 7-6 SHALL be terminated by a separator character, unless it is the last element string to be encoded, when a separator character SHOULD NOT be used. The separator character is placed immediately after a non-predefined length element string and is followed by the GS1 Application Identifier of the next element string. The separator character used is either the Function 1 Symbol Character (FNC1) or the control character (ASCII value 29 (decimal), 1D (hexadecimal)) and it is always represented in the transmitted message by the control character (ASCII value 29 (decimal), 1D (hexadecimal)). If the element string is the last to be encoded, it is followed by the Symbol Check and stop characters.

For example, concatenation of price per unit of measure (365 currency units) and batch number (123456) MUST use a separator character immediately after the price per unit of measure.

Price per unit of measure 365 Batch number 123456

Figure 7-11 Data encoded in two GS1-128 symbols

Price per unit of measure 365 Batch number 123456

Figure 7-12 Data encoded in one concatenated GS1-128 symbol

Note: The FNC1 is not shown in human readable interpretation.

7.8.6.3 Other considerations when using concatenation

Concatenation is an effective means for presenting multiple element strings in a single barcode and is used to conserve label space and optimise scanning operations when permitted by the application standard.

When concatenating a mixture of predefined length and other element strings, the predefined element strings SHOULD appear together before the other element strings. This usually results in a shorter linear barcode.

The separator character appears in the decoded data string as control character (ASCII value 29, (decimal), 1D (hexadecimal)). A separator character SHOULD NOT be used at the end of the last element string encoded in a GS1 barcode.

Notwithstanding the above, the processing routine SHALL tolerate a single separator character immediately following any element string, whether necessary or not, and process the data in accordance with section 7.8 Processing of data from a GS1 symbology using GS1 Application Identifiers.

(01)90614141000015(3202)000150

Figure 7-13 Example of GS1 DataBar Expanded Stacked barcode that uses concatenation

Concatenation may not be desirable in all circumstances (e.g., GS1 Logistic Labels are often constructed using multiple rows of barcode), in such cases the barcode containing the additional attribute data encoded using GS1 Application Identifiers SHOULD be printed in close proximity to the barcode containing the GS1 identification key.

(15)021231

Figure 7-14 Example of mixed GS1 symbologies (GTIN encoded in UPC-E, Best before date in Composite)

7.8.7 GS1 Application Identifiers with implied decimal point positions

For all GS1 Application Identifiers with an implied decimal point position, the following rules apply: For predefined length AIs For predefined length GS1 Application Identifiers with a data field length of 9 or less, the

  • maximum number of decimal places is equal to the length of the AI data field as indicated in the format of the GS1 Application Identifier, minus 1. For example, for an AI with data format N8 the maximum number of decimal places is 7. For predefined length GS1 Application Identifiers with a length greater than 9, the maximum

  • number of decimal places is 9. For example, for an AI with data format N12 the maximum number of decimal places is 9. Example for predefined length AIs: The data field format of AI (394n) is N4, so the maximum number of implied decimal places is 3. Element string (3943)1020 specifies that the data field includes 3 decimal places and therefore has an implied decimal point after the first digit: 1.020 For variable-length AIs For variable-length GS1 Application Identifiers with encoded data of 9 digits or less, the

  • maximum number of decimal places is equal to the length of the encoded data, minus 1. For example, for a data field containing 4 digits the maximum number of decimal places is 3. For variable-length GS1 Application Identifiers with encoded data of more than 9 digits, the

  • maximum number of decimal places is 9. For example, for a data field containing 11 digits the maximum number of decimal places is 9. Example for variable-length AIs: The data field format of AI (392n) is N..15, so the maximum number of implied decimal places is 9. Element string (3929)300123456789 specifies a data field of 12 digits that includes 9 decimal places and therefore has an implied decimal point after the third digit: 300.123456789.

Element string (3923)3000200 specifies a data field of 7 digits that includes 3 decimal places and therefore has an implied decimal point after the fourth digit: 3000.200 Note: Consult the specific GS1 Application Identifier for additional restrictions that may apply to that GS1 Application Identifier.

7.8.8 National Healthcare Reimbursement Number (NHRN)

Some national or regional regulatory organisations may require pharmaceuticals and/or medical devices be identified with locally specific National Healthcare Reimbursement Numbers (NHRNs). For compliance with these national/regional regulatory or industry requirements where the GTIN does not meet current need, the trade item SHALL be identified with GTIN and AIs (710), (711), (712), (713), (714), (715) and (716) National Healthcare Reimbursement Number.

One or more NHRNs may be associated with a single GTIN and encoded within the appropriate GS1 Data carrier in order to meet multiple market business needs. See Table 7-7 for examples of multiple NHRNs.

Additional individual NHRN AIs can only be assigned by GS1 and only in response to a work request being submitted through GSMP.

Table 7-7 Examples of valid messages

Element strings in messageComment
AI 01AI 710GTIN Identification of a trade item + Country “A” NHRN
AI 01AI 710AI 711GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN
AI 01AI 710AI 711AI 712GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN + Country “C” NHRN
AI 01AI 710AI 711AI 712AI 713GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN + Country “C” NHRN + Country “D” NHRN
AI 01AI 710AI 711AI 712AI 713AI 714GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN + Country “C” NHRN + Country “D” NHRN + Country “E” NHRN
AI 01AI 710AI 711AI 712AI 713AI 714AI 715GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN + Country “C” NHRN + Country “D” NHRN + Country “E” NHRN + Country “F” NHRN
AI 01AI 710AI 711AI 712AI 713AI 714AI 715AI 716AI 717GTIN Identification of a trade item + Country “A” NHRN + Country “B” NHRN + Country “C” NHRN + Country “D” NHRN + Country “E” NHRN + Country “F” NHRN + Country “G” NHRN + Country “H” NHRN

7.9 Check digit/character calculations

7.9.1 Standard check digit calculations for GS1 data structures

This algorithm is identical for all fixed length numeric GS1 data structures (including GDTI, GLN, GRAI, etc.) that require a check digit.

Table 7-8 Check digit algorithm

Digit positions
GTIN-8N1N2N3N4N5N6N7N8
GTIN-12N1N2N3N4N5N6N7N8N9N10N11N12
GTIN-13N1N2N3N4N5N6N7N8N9N10N11N12N13
GTIN-14N1N2N3N4N5N6N7N8N9N10N11N12N13N14
17 digitsN1N2N3N4N5N6N7N8N9N10N11N12N13N14N15N16N17
18 digitsN1N2N3N4N5N6N7N8N9N10N11N12N13N14N15N16N17N18
Multiply value of each position by
x3X1x3x1x3x1x3x1x3x1x3x1x3x1x3x1x3
Accumulated results = sum
Subtract sum from nearest equal or higher multiple of ten = check digit 

Table 7-9 Check digit calculation example

Example of a check digit calculation for the 18-digit field
PositionsN1 N2 N3 N4 N5 N6 N7 N8 N9 N10 N11 N12 N13 N14 N15 N16 N17 N18
Number without check digit3761042500212345= 101
Step 1: multiply byxxxxxxxxxxxxxxxx
3131313131313131
Step 2: add up results to sum================
971810465006163125
Number with check digit376104250021234569

7.9.2 Check digit calculation for price/weight fields

To increase the security of reading a price or weight from a barcode, the check digit for these fields is not only calculated according to the methods described in the previous section, but also according to the procedure described in this section.

The basic principle of the check digit calculation is that each digit position in a price/weight field is assigned a weighting factor. Weighting factors are 2-, 3, 5+ and 5-. Each weighting factor affects the particular calculation for the position concerned. The result of such a calculation is called a weighted product. The tables that follow show the weighted products of the various weighting factors.

Table 7-10 Weighting factor 2

Weighting factor 2
Calculation rule: The digit is multiplied by 2. If the result has two digits, the tens digit is subtracted from the units digit. The units digit resulting is the weighted product.
Digit Weighted product0 01 22 43 64 85 96 17 38 59 7

Table 7-11 Weighting factor 3

Weighting factor 3
Calculation rule: The digit is multiplied by 3. The unit's digit of the result is the weighted product.
Digit Weighted product0 01 32 63 94 25 56 87 18 49 7

Table 7-12 Weighting factor 5+

Weighting factor 5+
Calculation rule: The digit is multiplied by 5. The units digit and the tens digit of the result are added together. The result of this sum is the weighted product.
Digit Weighted product0 01 52 13 64 25 76 37 88 49 9

Table 7-13 Weighting factor 5-

Weighting factor 5-
Calculation rule: The digit is multiplied by 5. The tens digit of the result is subtracted from the result. The unit's digit of the result of this subtraction is the weighted product.
Digit Weighted product0 01 52 93 44 85 36 77 28 69 1

7.9.3 Check digit calculation for the four-digit price field

Table 7-14 Assigned weighting factors

Assigned weighting factors
Digit position Weighting factor1 2-2 2-3 34 5-

Calculation step 1: Determine the weighted product for each number in Positions One to Four

  • according to the assigned weighting factors.

Calculation step 2: Add the products of step 1.

  • Calculation step 3: Multiply the result of step 2 by the factor 3. The unit's digit of the result is

  • the check digit.

Table 7-15 Example of a check digit calculation

Example of a check digit calculation
Position of price field 1 2 3 4
Assigned weighting factor 2- 2- 3 5- Amount 2 8 7 5
Step 1: weighted product according to figure 4 5 1 3 Step 2: sum + + + + = 1 3 Step 3: multiply by 3 = 3 9 (*)
(*) Unit position is the check digit.

7.9.4 Check digit calculation for the five-digit price field

Table 7-16 Assigned weighting factors

Assigned weighting factors
Digit positions Weighting factor1 5+2 2-3 5-4 5+5 2-

Calculation step 1: Determine the weighted product for each number in positions one to five

  • according to the assigned weighting factors.

Calculation step 2: Add the products of step 1.

  • Calculation step 3: Subtract the result from the nearest equal or higher multiple of 10.

  • Calculation step 4: Take the result and search for the same number in the weighted product

  • row of Table 7-17. The check digit is the number in the digit row of the same column.

Table 7-17 Example of a check digit calculation

Example of a check digit calculation
Price field positions 1 2 3 4 5
Assigned weighting factor 5+ 2- 5- 5+ 2- Amount 1 4 6 8 5
Step 1: weighted product according to figure 5 8 7 4 9 Step 2: sum + + + + + = 33 Step 3: result of subtraction (40 - 33) = 7 Step 4: weighted product 7 in the figure weighting factor 5- shows number 6 to be the check digit.

7.9.5 Check character calculation (for alphanumeric keys)

GS1's check character algorithm uses MOD 1021,32 to calculate the check character pair for use in alphanumeric data structures (GS1 AI encodable character set, see section 7.11). The check character pair utilises uppercase alpha and numeric characters (see below). The check character set reduces potential keying errors by removing 0, O and 1, I (similar looking numeric alpha characters) from the possible results. The check character pairing also becomes more readily recognised due to the uppercase alpha numeric character structure. The check character pair enables the detection of various keying and encoding errors, including but not limited to:

  • Character substitution(s)

  • Character transposition(s)

  • Logical shifts

  • Character addition(s)

  • Character omission(s)

Check character calculation steps: Calculation step 1: For each character, retrieve the assigned reference value from Table 7-18.

  • Calculation step 2: Each symbol character position is given a prime number weight. Beginning

  • with the right most non-check character (Xj) and progressing left to first character (N1) the prime weight increases 2, 3, 5, 7, 11, 13, to Wn; “Wn” denotes the nth prime number where “n” is the number of characters representing data not including the check character pair. Calculation step 3: Multiply each assigned reference value (from step 1) by the weight (from

  • step 2).

Calculation step 4: Total the results of the calculations in step 3.

  • Calculation step 5: Perform a MOD 1021 on the sum of the products (step 4).

  • Calculation step 6: The result of step 5 is the check character’s reference value.

  • Calculation step 7: Based on the check character’s reference value (Ck), determine the GMN

  • check character using the following:

a. Ck = C1 * 32 + C2, (C1, C2 are the assigned reference values for Table 7-18) i. C1 = INT (Ck / 32), (the whole number to the left of the decimal) ii. C2 = Ck MOD 32 b. Retrieve the alphanumeric characters for Xj+1 and Xj+2 using C1 and C2

Table 7-18 GS1 AI encodable character reference values

CharacterAssignedCharacterAssignedCharacterAssigned
setvaluesetvaluesetvalue
!0B30e60
"1C31f61
%2D32g62
&3E33h63
'4F34i64
(5G35j65
)6H36k66
*7I37l67
+8J38m68
,9K39n69
CharacterAssignedCharacterAssignedCharacterAssigned
setvaluesetvaluesetvalue
-10L40o70
.11M41p71
/12N42q72
013O43r73
114P44s74
215Q45t75
316R46u76
417S47v77
518T48w78
619U49x79
720V50y80
821W51z81
922X52
:23Y53
;24Z54
<25_55
=26a56
>27b57
?28c58
A29d59

Table 7-19 Check character reference values

CharacterAssignedCharacterAssignedCharacterAssigned
setvaluesetvaluesetvalue
20D11Q22
31E12R23
42F13S24
53G14T25
64H15U26
75J16V27
86K17W28
97L18X29
A8M19Y30
B9N20Z31
C10P21

Position P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 GMN 1 9 8 7 6 5 4 A d 4 X 4 b L Assigned value 14 22 21 20 19 18 17 29 59 17 52 17 57 40 Multiply by weighting X X X X X X X X X X X X X X factor (Wn) 83 79 73 71 67 61 59 53 47 43 41 37 31 29 Results to sum 1162 1738 1533 1420 1273 1098 1003 1537 2773 731 2132 629 1767 1160 Example of a check character calculation for 25-character GMN continued P25 Position P15 P16 P17 P18 P19 P20 P21 P22 P23 P24 2 K GMN 5 t t r 2 3 1 0 c Assigned value 18 75 75 73 15 16 14 13 58 Multiply by weighting X X X X X X X X X factor (Wn) 23 19 17 13 11 7 5 3 2 Results to sum 414 1425 1275 949 165 112 70 39 116 Summary totals Sum weighted assigned values 24521 MOD 1021 for the sum weighted assigned values 17 Integer Results of MOD 1021 Sum weighted assigned values divided by 32 0 Remainder of MOD 1021 Sum weighted assigned values multiplied by 32 17 2 Check character for position P24 referenced from Table 7-19 K Check character for position P25 referenced from Table 7-19

Figure 7-15 Example of a check character calculation (based on 25 character Global Model Number)

7.10 GTIN-12 and RCN-12 in a UPC-E barcode

Some of the GTIN-12 and RCN-12 number ranges beginning with the U.P.C. Prefix 0 may be represented in a small symbol called the UPC-E barcode (see section 2.1). The GTIN-12 or RCN-12 is condensed into a barcode consisting of six symbol character positions.

For application processing, the GTIN-12 or RCN-12 must be transformed into its full length by the barcode reader software or by the application software. There is no six-digit UPC-E barcode.

It is possible to create false UPC-E barcodes if the encodation rules are not properly observed. Whether the digits represented in a UPC-E barcode can be expanded correctly to a GTIN-12 is verified by the following tests.

Test 1: Verify the digits encoded in Positions 1 to 6 of the UPC-E barcode according to the diagram below. * These UPC-E barcodes were valid in previous specifications. Provision for accepting them must be made during decoding only.

Figure 7-16 Procedure for test 1

Test 2: Expand the digits encoded in the UPC-E barcode to the first 11 digits of the full length GTIN-12, calculate the check digit and compare it with the check digit decoded from the UPC-E barcode. If they do not match, it signifies an invalid symbol.

7.11 The GS1 subset of International Standard ISO/IEC 646

Table 7-20 lists all characters allowed for use in GS1 Application Identifier (AI) element strings with the exception of the Component and Parts Identifier and Digital Signatures (DigSig). Table 7-20 corresponds to ISO/IEC 646 Table 1. All other ISO 646 characters that are not listed here are not allowed in GS1 Application Identifier (AI) element strings. Table 7-21 lists all the characters allowed for use in the GS1 Application Identifier for Component and Parts Identifier. Table 7-22 lists all the characters allowed for use in the GS1 Application Identifier (AI) for Digital Signatures (DigSig).

Note that some transport process information may include accented / non-Latin characters and space characters which are not available in the subset of ISO/IEC 646 International Reference Version defined in Table 7-20. Some AIs in the range 4300 – 4320 may use the characters from the Table 7-20 in conjunction with percent-encoding as defined in RFC 3986 in order to support non-

Latin characters, with the plus sign (+) being accepted as a way of encoding a literal space character.

Table 7-20 GS1 AI encodable character set 82

GraphicNameCodedGraphicNameCoded
symbolrepresentationsymbolrepresentation
!Exclamation mark2/1MCapital letter M4/13
"Quotation mark2/2NCapital letter N4/14
%Percent sign2/5OCapital letter O4/15
&Ampersand2/6PCapital letter P5/0
'Apostrophe2/7QCapital letter Q5/1
(Left parenthesis2/8RCapital letter R5/2
)Right parenthesis2/9SCapital letter S5/3
*Asterisk2/10TCapital letter T5/4
+Plus sign2/11UCapital letter U5/5
,Comma2/12VCapital letter V5/6
-Hyphen/Minus2/13WCapital letter W5/7
.Full stop2/14XCapital letter X5/8
/Solidus2/15YCapital letter Y5/9
0Digit zero3/0ZCapital letter Z5/10
1Digit one3/1_Low line5/15
2Digit two3/2aSmall letter a6/1
3Digit three3/3bSmall letter b6/2
4Digit four3/4cSmall letter c6/3
5Digit five3/5dSmall letter d6/4
6Digit six3/6eSmall letter e6/5
7Digit seven3/7fSmall letter f6/6
8Digit eight3/8gSmall letter g6/7
9Digit nine3/9hSmall letter h6/8
:Colon3/10iSmall letter i6/9
;Semicolon3/11jSmall letter j6/10
<Less-than sign3/12kSmall letter k6/11
=Equals sign3/13lSmall letter l6/12
>Greater-than sign3/14mSmall letter m6/13
?Question mark3/15nSmall letter n6/14
ACapital letter A4/1oSmall letter o6/15
BCapital letter B4/2pSmall letter p7/0
CCapital letter C4/3qSmall letter q7/1
DCapital letter D4/4rSmall letter r7/2
ECapital letter E4/5sSmall letter s7/3
FCapital letter F4/6tSmall letter t7/4
GCapital letter G4/7uSmall letter u7/5
HCapital letter H4/8vSmall letter v7/6
ICapital letter I4/9wSmall letter w7/7
JCapital letter J4/10xSmall letter x7/8
KCapital letter K4/11ySmall letter y7/9
LCapital letter L4/12zSmall letter z7/10

Table 7-21 GS1 AI encodable character set 39

GraphicNameCodedGraphic symbolNameCoded representation
symbolrepresentation
#Number Sign2/3HCapital letter H4/8
-Hyphen/Minus2/13ICapital letter I4/9
/Solidus2/15JCapital letter J4/10
0Digit zero3/0KCapital letter K4/11
1Digit one3/1LCapital letter L4/12
2Digit two3/2MCapital letter M4/13
3Digit three3/3NCapital letter N4/14
4Digit four3/4OCapital letter O4/15
5Digit five3/5PCapital letter P5/0
6Digit six3/6QCapital letter Q5/1
7Digit seven3/7RCapital letter R5/2
8Digit eight3/8SCapital letter S5/3
9Digit nine3/9TCapital letter T5/4
ACapital letter A4/1UCapital letter U5/5
BCapital letter B4/2VCapital letter V5/6
CCapital letter C4/3WCapital letter W5/7
DCapital letter D4/4XCapital letter X5/8
ECapital letter E4/5YCapital letter Y5/9
FCapital letter F4/6ZCapital letter Z5/10
GCapital letter G4/7Intentionally left blank

Table 7-22 GS1 AI encodable character set 64 (file-safe / URI-safe base64)

ValueGraphicNameCoded representationValueGraphicNameCoded
symbolsymbolrepresentation
0ACapital letter A4/132gSmall letter g6/7
1BCapital letter B4/233hSmall letter h6/8
2CCapital letter C4/334iSmall letter i6/9
3DCapital letter D4/435jSmall letter j6/10
4ECapital letter E4/536kSmall letter k6/11
5FCapital letter F4/637lSmall letter l6/12
6GCapital letter G4/738mSmall letter m6/13
7HCapital letter H4/839nSmall letter n6/14
8ICapital letter I4/940oSmall letter o6/15
9JCapital letter J4/1041pSmall letter p7/0
10KCapital letter K4/1142qSmall letter q7/1
11LCapital letter L4/1243rSmall letter r7/2
12MCapital letter M4/1344sSmall letter s7/3
13NCapital letter N4/1445tSmall letter t7/4
14OCapital letter O4/1546uSmall letter u7/5
15PCapital letter P5/047vSmall letter v7/6
16QCapital letter Q5/148wSmall letter w7/7
17RCapital letter R5/249xSmall letter x7/8
18SCapital letter S5/350ySmall letter y7/9
19TCapital letter T5/451zSmall letter z7/10
20UCapital letter U5/5520Digit zero3/0
ValueGraphicNameCodedValueGraphicNameCoded
symbolrepresentationsymbolrepresentation
21VCapital letter V5/6531Digit one3/1
22WCapital letter W5/7542Digit two3/2
23XCapital letter X5/8553Digit three3/3
24YCapital letter Y5/9564Digit four3/4
25ZCapital letter Z5/10575Digit five3/5
26aSmall letter a6/1586Digit six3/6
27bSmall letter b6/2597Digit seven3/7
28cSmall letter c6/3608Digit eight3/8
29dSmall letter d6/4619Digit nine3/9
30eSmall letter e6/562-Hyphen/minus2/13
3131ffSmall letter f6/66363__Low line / underscore / underline5/15
Intentionally left blankN/A=Equals (pad character)3/13

Note 1: The permitted characters for use with AI (8030) Digital Signature (DigSig) are the GS1 encodable character set 64 (file-safe / URI-safe base64) ordered alphabet as defined in section 5 of RFC 4648, which consists of the upper-case letters A-Z, lower-case letters a-z, digits 0-9, hyphen (-), low line/underscore/underline (_) and the equals character (=) as a special pad character (Table 7-22).

These 65 characters – a total of 64 characters and the special pad character - are a subset of the GS1 AI encodable character set 82 (Table 7-20). A maximum length of 90 characters corresponds to a maximum capacity of 540 bits. Although a Digital Signature (DigSig) AI (8030) value may contain a Base64 pad character (=), it can be removed without causing any loss of information. When expressed within the query string of a GS1 Digital Link URI, the Base64 pad character (=) SHOULD be removed, in accordance with section 5 of RFC 4648, however if it is required, the Base64 pad character SHALL be percent-encoded, as defined in RFC 3986 Note also that these characters are not freely chosen by the user but are instead a compact representation of a binary value for the calculated ISO/IEC 20248 data construct which contains the digital signature, expressed using one file-safe/URI-safe base64 character per 6 bits.

7.12 Determination of century in dates

Element strings are available for the following types of dates: Production date: AI (11).

  • Due date: AI (12).

  • Packaging date: AI (13).

  • Best before date: AI (15).

  • Sell by date: AI (16).

  • Expiration date: AI (17).

  • Expiration date and time: AI (7003).

  • First freeze date: AI (7006).

  • Harvest date: AI (7007).

  • Date and time of production: AI (8008).

  • It is left to the discretion of the user to interpret a particular date type in the sense of his business practices. Such interpretation may change according to the product range for which a date is being applied. Since the year data field consists of two positions, the century is established by following the procedure in the figure below.

Figure 7-17 Determination of century

Note: The element string can only specify a date in the range from 49 years in the past to 50 years in the future of the current year

7.13 Conversion of latitude and longitude to twenty-digit string

A latitude and longitude (both expressed in decimal degrees using the WGS84 coordinate reference system) can be converted into two 10-digit fields, X and Y as follows:

$$ X = 10{,}000{,}000 \times (\text{WGS84 latitude} + 90) $$

$$ Y = 10{,}000{,}000 \times ((\text{WGS84 longitude} + 360) \bmod 360) $$

X and Y SHALL be integer values.

Note: The WGS84 latitude and longitude SHOULD be expressed with no more than 7 decimal places. If the calculation of either X or Y results in fewer than 10 digits then the value must be left-padded with ‘0’ to reach a total of 10 digits per value.

For GS1 AIs encoding geocoordinates, X and Y are concatenated into a single string of twenty digits. For example, Machu Picchu Antarctica Base’s latitude (-62.0914152°) and longitude (-58.4702029°) would be converted to 0279085848 and 3015297971, resulting in a final data element of 02790858483015297971

7.14 Conversion of twenty-digit string to latitude and longitude

A twenty digit geocode contains two ten-digit fields, X and Y, that can be converted to latitude and longitude values in the WGS84 coordinate reference system (expressed in decimal degrees) using the following calculations:

X, the first 10 digits can be converted to WGS84 latitude using the following calculation:

$$ \text{WGS84 latitude} = ((X / 10{,}000{,}000) - 90)^\circ $$

Y, the second group of 10 digits can be converted to WGS84 longitude using the following calculation:

$$ \text{WGS84 longitude} = ((((Y / 10{,}000{,}000) + 180) \bmod 360) - 180)^\circ $$


返回目录

上一篇:6 Barcode placement

下一篇:8 Application Standard Profiles

原文链接:GS1 General Specifications Standard