Gs1Builder
public static class Gs1BuilderHelpers to build GS1 element strings ("(AI)value…") for the GS1 symbologies.
Methods
| Method Signature | Returns | Description |
|---|---|---|
static # Build(params (string, string)[] elements) | string | Element string of (AI, value) pairs, e.g. Build(("01", gtin), ("10", "LOT1")). |
static # CheckDigit(string digits) | int | GS1 mod-10 check digit of a digit string (GTIN, SSCC, GLN …). |
static # Date(string ai, DateOnly date) | string | Date AI value YYMMDD, e.g. Date("17", expiry) for (17) expiration date. |
static # Element(string ai, string value) | string | One element "(AI)value". |
static # Gtin(string gtin) | string | AI (01): GTIN-8/12/13/14 padded to 14 digits; a 7/11/12/13-digit input gets its check digit. |
static # IsKnownAi(string ai) | bool | True when the AI is defined in the GS1 table. |
static # IsValidCheckDigit(string digitsWithCheck) | bool | True when the last digit is the correct GS1 check digit. |
static # Measure(string ai3, decimal value, int decimals) | string | Measure AI with implied decimal point: ai3 is the 3-digit base (e.g. "310" net weight kg), the 4th digit is the number of decimals; value padded to 6 digits. Measure("310", 1.5m, 3) → "(3103)001500". |
static # Sscc(string sscc) | string | AI (00): SSCC from 17 digits (check digit added) or 18 digits (validated). |
static # WithCheckDigit(string digits) | string | Digits with their GS1 check digit appended. |

