AIDC Toolkit / GS1
GS1 Package
Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Overview
WARNING
This software is in beta, with production release is scheduled for 2025Q4. To follow the status of this and other projects, go to the AIDC Toolkit projects page.
The AIDC Toolkit gs1 package provides functionality related to the GS1 identification system. It builds on the utility package, providing validation and creation functions customized for GS1 identification keys (e.g., including check digit validation and creation). All logic in this package is as defined in the GS1 General Specifications.
Check calculation and validation functions
The check calculation and validation functions are separate from the string validation and creation functions so that they may be used in other contexts. All the check calculation functions defined in the GS1 General Specifications are implemented.
Check digit - GS1 identification key
The checkDigit function calculates the check digit for a numeric GS1 identification key.
The hasValidCheckDigit function validates the check digit for a numeric GS1 identification key.
Check digit - price or weight encoding
The priceOrWeightCheckDigit function calculates the check digit for a price or weight.
The isValidPriceOrWeightCheckDigit function validates the check digit for a price or weight.
These functions are seldom used directly, as there are no use cases for prices or weights on their own. They are used by the variable measure RCN functions if the RCN format requires a price or weight check digit.
Check character pair - GS1 identification key
The checkCharacterPair function calculates the check character pair for a non-numeric GS1 identification key, if supported.
The hasValidCheckCharacterPair function validates the check character pair for a non-numeric GS1 identification key, if supported.
GS1 identification keys
At the core of the AIDC Toolkit gs1 package is GS1 identification key validation and creation. All GS1 identification key types are supported. A working knowledge of the GS1 General Specifications is highly recommended.
Prefix manager
Prefix type
GS1 identification key validation
GS1 identification key creation
Type Aliases
- GS1LocaleResources
- PrefixType
- IdentifierType
- ContentCharacterSet
- NumericIdentifierType
- LeaderType
- GTINType
- GTINLevel
- NonGTINNumericIdentifierType
- SerializableNumericIdentifierType
- NonNumericIdentifierType
Interfaces
- PrefixValidation
- IdentifierValidation
- IdentifierValidator
- NumericIdentifierValidator
- RCNReference
- NonNumericIdentifierValidation
- IdentifierCreator
- NumericIdentifierCreator
Classes
- AbstractIdentifierValidator
- AbstractNumericIdentifierValidator
- GTINValidator
- NonGTINNumericIdentifierValidator
- SerializableNumericIdentifierValidator
- NonNumericIdentifierValidator
- AbstractIdentifierCreator
- AbstractNumericIdentifierCreator
- GTINCreator
- NonGTINNumericIdentifierCreator
- SerializableNumericIdentifierCreator
- NonNumericIdentifierCreator
- PrefixManager
Variables
- gs1NS
- gs1Resources
- i18nextGS1
- AI82_CREATOR
- AI82_VALIDATOR
- AI39_CREATOR
- AI39_VALIDATOR
- PrefixTypes
- PrefixValidator
- IdentifierTypes
- ContentCharacterSets
- LeaderTypes
- GTINTypes
- GTINLevels
- GTIN13_VALIDATOR
- GTIN12_VALIDATOR
- GTIN8_VALIDATOR
- GTIN_VALIDATORS
- GLN_VALIDATOR
- SSCC_VALIDATOR
- GSRN_VALIDATOR
- GSIN_VALIDATOR
- GRAI_VALIDATOR
- GDTI_VALIDATOR
- GCN_VALIDATOR
- GIAI_VALIDATOR
- GINC_VALIDATOR
- CPID_VALIDATOR
- GMN_VALIDATOR