diff --git a/backend/gs1.c b/backend/gs1.c index db6f6399..2dc1d13a 100644 --- a/backend/gs1.c +++ b/backend/gs1.c @@ -160,6 +160,61 @@ static int csum(const unsigned char *data, int data_len, int offset, int min, in return 1; } +/* Check alphanumeric check characters (GS1 General Spec 7.9.5) */ +static int csumalpha(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no, + int *p_err_posn, char err_msg[50], const int length_only) { + (void)max; + + data_len -= offset; + + if (data_len < min) { + return 0; + } + if (data_len && data_len < 2) { /* Do this check separately for backward compatibility */ + *p_err_no = 4; + return 0; + } + + if (!length_only && data_len) { + static const char c82[] = { + 0, 1, -1, -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, /*!-0*/ + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1, /*1-@*/ + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, /*A-P*/ + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, -1, -1, -1, -1, 55, -1, /*Q-`*/ + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, /*a-p*/ + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, /*q-z*/ + }; + static const char c32[] = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ"; + static const char weights[] = { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83 + }; + const unsigned char *d = data + offset; + const unsigned char *de = d + (data_len > max ? max : data_len) - 2; /* Note less last 2 characters */ + int checksum = 0, c1, c2; + + for (; d < de; d++) { + checksum += c82[*d - '!'] * weights[de - 1 - d]; + } + checksum %= 1021; + c1 = c32[checksum >> 5]; + c2 = c32[checksum & 0x1F]; + + if (de[0] != c1 || de[1] != c2) { + *p_err_no = 3; + if (de[0] != c1) { + *p_err_posn = (de - data) + 1; + sprintf(err_msg, "Bad checksum '%c', expected '%c'", de[0], c1); + } else { + *p_err_posn = (de + 1 - data) + 1; + sprintf(err_msg, "Bad checksum '%c', expected '%c'", de[1], c2); + } + return 0; + } + } + + return 1; +} + /* Check for a GS1 Prefix (GS1 General Spec GS1 1.4.2) */ static int key(const unsigned char *data, int data_len, int offset, int min, int max, int *p_err_no, int *p_err_posn, char err_msg[50], const int length_only) { @@ -943,7 +998,8 @@ static int couponcode(const unsigned char *data, int data_len, int offset, int m if (d == NULL) { return 0; } - d = coupon_vli(data, data_len, d, "2nd Purch. GS1 Co. Prefix", 6, 0, 6, 1, p_err_no, p_err_posn, err_msg); + d = coupon_vli(data, data_len, d, "2nd Purch. GS1 Co. Prefix", 6, 0, 6, 1, p_err_no, p_err_posn, + err_msg); if (d == NULL) { return 0; } @@ -968,7 +1024,8 @@ static int couponcode(const unsigned char *data, int data_len, int offset, int m if (d == NULL) { return 0; } - d = coupon_vli(data, data_len, d, "3rd Purch. GS1 Co. Prefix", 6, 0, 6, 1, p_err_no, p_err_posn, err_msg); + d = coupon_vli(data, data_len, d, "3rd Purch. GS1 Co. Prefix", 6, 0, 6, 1, p_err_no, p_err_posn, + err_msg); if (d == NULL) { return 0; } @@ -1048,7 +1105,8 @@ static int couponcode(const unsigned char *data, int data_len, int offset, int m *p_err_no = 3; *p_err_posn = d - 1 - data + 1; - sprintf(err_msg, data_field < 0 ? "Non-numeric Data Field '%c'" : "Invalid Data Field '%c'", *(d - 1)); + sprintf(err_msg, data_field < 0 ? "Non-numeric Data Field '%c'" : "Invalid Data Field '%c'", + *(d - 1)); return 0; } } diff --git a/backend/gs1_lint.h b/backend/gs1_lint.h index 6208b1ff..77130c92 100644 --- a/backend/gs1_lint.h +++ b/backend/gs1_lint.h @@ -467,6 +467,17 @@ static int n__12_nozeroprefix(const unsigned char *data, const int data_len, && nozeroprefix(data, data_len, 0, 1, 12, p_err_no, p_err_posn, err_msg, 0); } +/* X..25,csumalpha,key */ +static int x__25_csumalpha_key(const unsigned char *data, const int data_len, + int *p_err_no, int *p_err_posn, char err_msg[50]) { + return data_len >= 1 && data_len <= 25 + && csumalpha(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) + && key(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg, 1 /*length_only*/) + && cset82(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg) + && csumalpha(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg, 0) + && key(data, data_len, 0, 1, 25, p_err_no, p_err_posn, err_msg, 0); +} + /* N18,csum */ static int n18_csum(const unsigned char *data, const int data_len, int *p_err_no, int *p_err_posn, char err_msg[50]) { @@ -768,7 +779,7 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, if (ai == 8003) { return n1_zero_n13_csum_key_x0__16(data, data_len, p_err_no, p_err_posn, err_msg); } - if (ai == 8004 || ai == 8013) { + if (ai == 8004) { return x__30_key(data, data_len, p_err_no, p_err_posn, err_msg); } if (ai == 8005) { @@ -792,6 +803,9 @@ static int gs1_lint(const int ai, const unsigned char *data, const int data_len, if (ai == 8011) { return n__12_nozeroprefix(data, data_len, p_err_no, p_err_posn, err_msg); } + if (ai == 8013) { + return x__25_csumalpha_key(data, data_len, p_err_no, p_err_posn, err_msg); + } if (ai == 8017 || ai == 8018) { return n18_csum(data, data_len, p_err_no, p_err_posn, err_msg); } diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index 096b4e1c..e0f37d49 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -1162,126 +1162,127 @@ static void test_gs1_verify(int index, int debug) { /*852*/ { "[8011]1234567890123", ZINT_ERROR_INVALID_DATA, "" }, /*853*/ { "[8012]abcdefghijklmnopqrst", 0, "8012abcdefghijklmnopqrst" }, /*854*/ { "[8012]abcdefghijklmnopqrstuv", ZINT_ERROR_INVALID_DATA, "" }, - /*855*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz", 0, "80131234abcdefghijklmnopqrstuvwxyz" }, - /*856*/ { "[8013]1234abcdefghijklmnopqrstuvwxyz1", ZINT_ERROR_INVALID_DATA, "" }, - /*857*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*858*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*859*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, - /*860*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, - /*861*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*862*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*863*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, - /*864*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, - /*865*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, - /*866*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, - /*867*/ { "[8019]1234567890", 0, "80191234567890" }, - /*868*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*869*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, - /*870*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, - /*871*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*872*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*873*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, - /*874*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, - /*875*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, - /*876*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, - /*877*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*878*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*879*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*880*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*881*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*882*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*883*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*884*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*885*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*886*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*887*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*888*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*889*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, - /*890*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, - /*891*/ { "[8111]1234", 0, "81111234" }, - /*892*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, - /*893*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, - /*894*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, - /*895*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*896*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, - /*897*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*898*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*899*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*900*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*901*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*902*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*903*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*904*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*905*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, - /*906*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*907*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*908*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*909*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*910*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*911*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*912*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*913*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*914*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*915*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*916*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*917*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*918*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*919*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*920*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*921*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*922*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*923*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*924*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*925*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*926*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, - /*927*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, - /*928*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*929*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*930*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*931*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*932*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*933*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*934*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*935*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*936*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*937*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*938*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*939*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*940*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*941*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*942*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*943*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*944*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*945*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*946*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*947*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*948*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*949*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*950*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*951*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*952*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*953*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*954*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*955*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*956*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*957*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*958*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*959*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*960*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*961*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*962*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, - /*963*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, - /*964*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*965*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*966*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, - /*967*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, - /*968*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, - /*969*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, - /*970*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, - /*971*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, - /*972*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, - /*973*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, - /*974*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, + /*855*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" }, + /*856*/ { "[8013]1234abcdefghijklmnopqrsQP", 0, "80131234abcdefghijklmnopqrsQP" }, + /*857*/ { "[8013]1234abcdefghijklmnopqrsQPv", ZINT_ERROR_INVALID_DATA, "" }, + /*858*/ { "[8014]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*859*/ { "[8016]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*860*/ { "[8017]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8017313131313131313139" }, + /*861*/ { "[8017]313131313131313131", 0, "8017313131313131313131" }, + /*862*/ { "[8017]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*863*/ { "[8017]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*864*/ { "[8018]313131313131313139", ZINT_WARN_NONCOMPLIANT, "8018313131313131313139" }, + /*865*/ { "[8018]313131313131313131", 0, "8018313131313131313131" }, + /*866*/ { "[8018]31313131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /*867*/ { "[8018]3131313131313131390", ZINT_ERROR_INVALID_DATA, "" }, + /*868*/ { "[8019]1234567890", 0, "80191234567890" }, + /*869*/ { "[8019]12345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*870*/ { "[8020]abcdefghijklmnopqrstuvwxy", 0, "8020abcdefghijklmnopqrstuvwxy" }, + /*871*/ { "[8020]abcdefghijklmnopqrstuvwxyz", ZINT_ERROR_INVALID_DATA, "" }, + /*872*/ { "[8021]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*873*/ { "[8025]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*874*/ { "[8026]123456789012341212", ZINT_WARN_NONCOMPLIANT, "8026123456789012341212" }, + /*875*/ { "[8026]123456789012311212", 0, "8026123456789012311212" }, + /*876*/ { "[8026]1234567890123451212", ZINT_ERROR_INVALID_DATA, "" }, + /*877*/ { "[8026]12345678901234512", ZINT_ERROR_INVALID_DATA, "" }, + /*878*/ { "[8027]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*879*/ { "[8030]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*880*/ { "[8040]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*881*/ { "[8050]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*882*/ { "[8060]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*883*/ { "[8070]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*884*/ { "[8080]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*885*/ { "[8090]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*886*/ { "[8099]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*887*/ { "[81]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*888*/ { "[8100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*889*/ { "[8109]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*890*/ { "[8110]5123456789011234565123455123450123105123450123512345678901320123190000", 0, "81105123456789011234565123455123450123105123450123512345678901320123190000" }, + /*891*/ { "[8110]51234567890112345651234551234501231051234501235123456789013201231900001", ZINT_ERROR_INVALID_DATA, "" }, + /*892*/ { "[8111]1234", 0, "81111234" }, + /*893*/ { "[8111]12345", ZINT_ERROR_INVALID_DATA, "" }, + /*894*/ { "[8111]123", ZINT_ERROR_INVALID_DATA, "" }, + /*895*/ { "[8112]1234567890123456789012345678901234567890123456789012345678901234567890", ZINT_WARN_NONCOMPLIANT, "81121234567890123456789012345678901234567890123456789012345678901234567890" }, + /*896*/ { "[8112]12345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*897*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345" }, + /*898*/ { "[8113]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*899*/ { "[8120]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*900*/ { "[8130]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*901*/ { "[8140]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*902*/ { "[8150]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*903*/ { "[8190]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*904*/ { "[8199]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*905*/ { "[82]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*906*/ { "[8200]1234567890123456789012345678901234567890123456789012345678901234567890", 0, "82001234567890123456789012345678901234567890123456789012345678901234567890" }, + /*907*/ { "[8201]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*908*/ { "[8210]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*909*/ { "[8220]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*910*/ { "[8230]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*911*/ { "[8240]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*912*/ { "[8250]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*913*/ { "[8290]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*914*/ { "[8299]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*915*/ { "[83]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*916*/ { "[830]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*917*/ { "[8300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*918*/ { "[84]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*919*/ { "[840]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*920*/ { "[8400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*921*/ { "[85]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*922*/ { "[850]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*923*/ { "[8500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*924*/ { "[89]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*925*/ { "[890]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*926*/ { "[8900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*927*/ { "[90]abcdefghijklmnopqrstuvwxyz1234", 0, "90abcdefghijklmnopqrstuvwxyz1234" }, + /*928*/ { "[90]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, + /*929*/ { "[900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*930*/ { "[9000]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*931*/ { "[91]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "91123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*932*/ { "[91]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*933*/ { "[910]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*934*/ { "[9100]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*935*/ { "[92]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*936*/ { "[92]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*937*/ { "[920]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*938*/ { "[9200]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*939*/ { "[93]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "93123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*940*/ { "[93]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*941*/ { "[930]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*942*/ { "[9300]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*943*/ { "[94]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "94123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*944*/ { "[94]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*945*/ { "[940]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*946*/ { "[9400]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*947*/ { "[95]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "95123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*948*/ { "[95]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*949*/ { "[950]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*950*/ { "[9500]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*951*/ { "[96]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "96123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*952*/ { "[96]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*953*/ { "[960]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*954*/ { "[9600]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*955*/ { "[97]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "97123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*956*/ { "[97]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*957*/ { "[970]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*958*/ { "[9700]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*959*/ { "[98]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "98123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*960*/ { "[98]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*961*/ { "[980]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*962*/ { "[9800]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*963*/ { "[99]123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, "99123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" }, + /*964*/ { "[99]1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901", ZINT_ERROR_INVALID_DATA, "" }, + /*965*/ { "[990]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*966*/ { "[9900]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*967*/ { "[9999]1234", ZINT_ERROR_INVALID_DATA, "" }, + /*968*/ { "[01]12345678901234[7006]200101", ZINT_WARN_NONCOMPLIANT, "01123456789012347006200101" }, + /*969*/ { "[01]12345678901231[7006]200101", 0, "01123456789012317006200101" }, + /*970*/ { "[3900]1234567890[01]12345678901234", ZINT_WARN_NONCOMPLIANT, "39001234567890[0112345678901234" }, + /*971*/ { "[3900]1234567890[01]12345678901231", 0, "39001234567890[0112345678901231" }, + /*972*/ { "[253]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[390112345678901234[2012" }, + /*973*/ { "[253]12345678901284[3901]12345678901234[20]12", 0, "25312345678901284[390112345678901234[2012" }, + /*974*/ { "[253]12345678901234[01]12345678901234[3901]12345678901234[20]12", ZINT_WARN_NONCOMPLIANT, "25312345678901234[0112345678901234390112345678901234[2012" }, + /*975*/ { "[253]12345678901284[01]12345678901231[3901]12345678901234[20]12", 0, "25312345678901284[0112345678901231390112345678901234[2012" }, }; int data_size = ARRAY_SIZE(data); @@ -1338,312 +1339,354 @@ static void test_gs1_lint(int index, int debug) { /* 12*/ { "[8010]6789ABCDEFGHIJKLMNOPQRSTUVWXY}", ZINT_WARN_NONCOMPLIANT, "80106789ABCDEFGHIJKLMNOPQRSTUVWXY}", "261: AI (8010) position 30: Invalid CSET 39 character '}'" }, // cset39 /* 13*/ { "[8010]#-/0123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "8010#-/0123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) position 1: Non-numeric company prefix '#'" }, // key /* 14*/ { "[8010]0#-/123456789ABCDEFGHIJKLMNOPQ", ZINT_WARN_NONCOMPLIANT, "80100#-/123456789ABCDEFGHIJKLMNOPQ", "261: AI (8010) position 2: Non-numeric company prefix '#'" }, // key - /* 15*/ { "[11]120100", 0, "11120100", "" }, // yymmd0 - /* 16*/ { "[11]120131", 0, "11120131", "" }, // yymmd0 - /* 17*/ { "[11]120132", ZINT_WARN_NONCOMPLIANT, "11120132", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 18*/ { "[11]120229", 0, "11120229", "" }, // yymmd0 - /* 19*/ { "[11]110229", ZINT_WARN_NONCOMPLIANT, "11110229", "261: AI (11) position 5: Invalid day '29'" }, // yymmd0 - /* 20*/ { "[11]000229", 0, "11000229", "" }, // yymmd0 NOTE: will be false in 2050 - /* 21*/ { "[11]480229", 0, "11480229", "" }, // yymmd0 - /* 22*/ { "[11]500229", ZINT_WARN_NONCOMPLIANT, "11500229", "261: AI (11) position 5: Invalid day '29'" }, // yymmd0 - /* 23*/ { "[11]980229", ZINT_WARN_NONCOMPLIANT, "11980229", "261: AI (11) position 5: Invalid day '29'" }, // yymmd0 - /* 24*/ { "[11]110228", 0, "11110228", "" }, // yymmd0 - /* 25*/ { "[11]120230", ZINT_WARN_NONCOMPLIANT, "11120230", "261: AI (11) position 5: Invalid day '30'" }, // yymmd0 - /* 26*/ { "[11]120331", 0, "11120331", "" }, // yymmd0 - /* 27*/ { "[11]120332", ZINT_WARN_NONCOMPLIANT, "11120332", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 28*/ { "[11]120430", 0, "11120430", "" }, // yymmd0 - /* 29*/ { "[11]120431", ZINT_WARN_NONCOMPLIANT, "11120431", "261: AI (11) position 5: Invalid day '31'" }, // yymmd0 - /* 30*/ { "[11]120531", 0, "11120531", "" }, // yymmd0 - /* 31*/ { "[11]120532", ZINT_WARN_NONCOMPLIANT, "11120532", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 32*/ { "[11]120630", 0, "11120630", "" }, // yymmd0 - /* 33*/ { "[11]120631", ZINT_WARN_NONCOMPLIANT, "11120631", "261: AI (11) position 5: Invalid day '31'" }, // yymmd0 - /* 34*/ { "[11]120731", 0, "11120731", "" }, // yymmd0 - /* 35*/ { "[11]120732", ZINT_WARN_NONCOMPLIANT, "11120732", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 36*/ { "[11]120831", 0, "11120831", "" }, // yymmd0 - /* 37*/ { "[11]120832", ZINT_WARN_NONCOMPLIANT, "11120832", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 38*/ { "[11]120930", 0, "11120930", "" }, // yymmd0 - /* 39*/ { "[11]120931", ZINT_WARN_NONCOMPLIANT, "11120931", "261: AI (11) position 5: Invalid day '31'" }, // yymmd0 - /* 40*/ { "[11]121031", 0, "11121031", "" }, // yymmd0 - /* 41*/ { "[11]121032", ZINT_WARN_NONCOMPLIANT, "11121032", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 42*/ { "[11]121130", 0, "11121130", "" }, // yymmd0 - /* 43*/ { "[11]121131", ZINT_WARN_NONCOMPLIANT, "11121131", "261: AI (11) position 5: Invalid day '31'" }, // yymmd0 - /* 44*/ { "[11]121200", 0, "11121200", "" }, // yymmd0 - /* 45*/ { "[11]121231", 0, "11121231", "" }, // yymmd0 - /* 46*/ { "[11]121232", ZINT_WARN_NONCOMPLIANT, "11121232", "261: AI (11) position 5: Invalid day '32'" }, // yymmd0 - /* 47*/ { "[11]120031", ZINT_WARN_NONCOMPLIANT, "11120031", "261: AI (11) position 3: Invalid month '00'" }, // yymmd0 - /* 48*/ { "[11]121331", ZINT_WARN_NONCOMPLIANT, "11121331", "261: AI (11) position 3: Invalid month '13'" }, // yymmd0 - /* 49*/ { "[4326]121231", 0, "4326121231", "" }, // yymmdd - /* 50*/ { "[4326]121200", ZINT_WARN_NONCOMPLIANT, "4326121200", "261: AI (4326) position 5: Invalid day '00'" }, // yymmdd - /* 51*/ { "[4326]120031", ZINT_WARN_NONCOMPLIANT, "4326120031", "261: AI (4326) position 3: Invalid month '00'" }, // yymmdd - /* 52*/ { "[4326]129931", ZINT_WARN_NONCOMPLIANT, "4326129931", "261: AI (4326) position 3: Invalid month '99'" }, // yymmdd - /* 53*/ { "[4326]121299", ZINT_WARN_NONCOMPLIANT, "4326121299", "261: AI (4326) position 5: Invalid day '99'" }, // yymmdd - /* 54*/ { "[4326]120230", ZINT_WARN_NONCOMPLIANT, "4326120230", "261: AI (4326) position 5: Invalid day '30'" }, // yymmdd - /* 55*/ { "[4326]110229", ZINT_WARN_NONCOMPLIANT, "4326110229", "261: AI (4326) position 5: Invalid day '29'" }, // yymmdd - /* 56*/ { "[4326]000229", 0, "4326000229", "" }, // yymmdd NOTE: will be false in 2050 - /* 57*/ { "[4326]940229", ZINT_WARN_NONCOMPLIANT, "4326940229", "261: AI (4326) position 5: Invalid day '29'" }, // yymmdd - /* 58*/ { "[4324]1212310000", 0, "43241212310000", "" }, // hhmm - /* 59*/ { "[4324]1212312359", 0, "43241212312359", "" }, // hhmm - /* 60*/ { "[4324]1212312400", ZINT_WARN_NONCOMPLIANT, "43241212312400", "261: AI (4324) position 7: Invalid hour of day '24'" }, // hhmm - /* 61*/ { "[4324]1212312360", ZINT_WARN_NONCOMPLIANT, "43241212312360", "261: AI (4324) position 9: Invalid minutes in the hour '60'" }, // hhmm - /* 62*/ { "[8008]121231000000", 0, "8008121231000000", "" }, // hhoptmmss - /* 63*/ { "[8008]1212310000", 0, "80081212310000", "" }, // hhoptmmss - /* 64*/ { "[8008]12123100", 0, "800812123100", "" }, // hhoptmmss - /* 65*/ { "[8008]12123123", 0, "800812123123", "" }, // hhoptmmss - /* 66*/ { "[8008]12123124", ZINT_WARN_NONCOMPLIANT, "800812123124", "261: AI (8008) position 7: Invalid hour of day '24'" }, // hhoptmmss - /* 67*/ { "[8008]1212312359", 0, "80081212312359", "" }, // hhoptmmss - /* 68*/ { "[8008]1212312360", ZINT_WARN_NONCOMPLIANT, "80081212312360", "261: AI (8008) position 9: Invalid minutes in the hour '60'" }, // hhoptmmss - /* 69*/ { "[8008]121231235959", 0, "8008121231235959", "" }, // hhoptmmss - /* 70*/ { "[8008]121231235960", ZINT_WARN_NONCOMPLIANT, "8008121231235960", "261: AI (8008) position 11: Invalid seconds in the minute '60'" }, // hhoptmmss - /* 71*/ { "[422]004", 0, "422004", "" }, // iso3166 - /* 72*/ { "[422]894", 0, "422894", "" }, // iso3166 - /* 73*/ { "[422]00", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422)" }, // iso3166 - /* 74*/ { "[422]0A", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (422)" }, // iso3166 - /* 75*/ { "[422]003", ZINT_WARN_NONCOMPLIANT, "422003", "261: AI (422) position 1: Unknown country code '003'" }, // iso3166 - /* 76*/ { "[422]895", ZINT_WARN_NONCOMPLIANT, "422895", "261: AI (422) position 1: Unknown country code '895'" }, // iso3166 - /* 77*/ { "[422]999", ZINT_WARN_NONCOMPLIANT, "422999", "261: AI (422) position 1: Unknown country code '999'" }, // iso3166 - /* 78*/ { "[423]004", 0, "423004", "" }, // iso3166list - /* 79*/ { "[423]004894", 0, "423004894", "" }, // iso3166list - /* 80*/ { "[423]004894004", 0, "423004894004", "" }, // iso3166list - /* 81*/ { "[423]004894004894", 0, "423004894004894", "" }, // iso3166list - /* 82*/ { "[423]004894004894004", 0, "423004894004894004", "" }, // iso3166list - /* 83*/ { "[423]004894004894004894", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 84*/ { "[423]123894004894004894", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 85*/ { "[423]A04894004894004894", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 86*/ { "[423]00489400489400489", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 87*/ { "[423]0048940048940048", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 88*/ { "[423]00489400489400", ZINT_WARN_NONCOMPLIANT, "42300489400489400", "259: Invalid data length for AI (423)" }, // iso3166list - /* 89*/ { "[423]0048940048940", ZINT_WARN_NONCOMPLIANT, "4230048940048940", "259: Invalid data length for AI (423)" }, // iso3166list - /* 90*/ { "[423]00489400489", ZINT_WARN_NONCOMPLIANT, "42300489400489", "259: Invalid data length for AI (423)" }, // iso3166list - /* 91*/ { "[423]0048940048", ZINT_WARN_NONCOMPLIANT, "4230048940048", "259: Invalid data length for AI (423)" }, // iso3166list - /* 92*/ { "[423]00489400", ZINT_WARN_NONCOMPLIANT, "42300489400", "259: Invalid data length for AI (423)" }, // iso3166list - /* 93*/ { "[423]0048940", ZINT_WARN_NONCOMPLIANT, "4230048940", "259: Invalid data length for AI (423)" }, // iso3166list - /* 94*/ { "[423]00489", ZINT_WARN_NONCOMPLIANT, "42300489", "259: Invalid data length for AI (423)" }, // iso3166list - /* 95*/ { "[423]0048", ZINT_WARN_NONCOMPLIANT, "4230048", "259: Invalid data length for AI (423)" }, // iso3166list - /* 96*/ { "[423]00", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 97*/ { "[423]0", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (423)" }, // iso3166list - /* 98*/ { "[423]004894004894003", ZINT_WARN_NONCOMPLIANT, "423004894004894003", "261: AI (423) position 13: Unknown country code '003'" }, // iso3166list - /* 99*/ { "[423]004894004895004", ZINT_WARN_NONCOMPLIANT, "423004894004895004", "261: AI (423) position 10: Unknown country code '895'" }, // iso3166list - /*100*/ { "[423]004894004999004", ZINT_WARN_NONCOMPLIANT, "423004894004999004", "261: AI (423) position 10: Unknown country code '999'" }, // iso3166list - /*101*/ { "[423]004894005894004", ZINT_WARN_NONCOMPLIANT, "423004894005894004", "261: AI (423) position 7: Unknown country code '005'" }, // iso3166list - /*102*/ { "[423]004893004894004", ZINT_WARN_NONCOMPLIANT, "423004893004894004", "261: AI (423) position 4: Unknown country code '893'" }, // iso3166list - /*103*/ { "[423]004999004894004", ZINT_WARN_NONCOMPLIANT, "423004999004894004", "261: AI (423) position 4: Unknown country code '999'" }, // iso3166list - /*104*/ { "[423]003894004894004", ZINT_WARN_NONCOMPLIANT, "423003894004894004", "261: AI (423) position 1: Unknown country code '003'" }, // iso3166list - /*105*/ { "[423]004894004433", ZINT_WARN_NONCOMPLIANT, "423004894004433", "261: AI (423) position 10: Unknown country code '433'" }, // iso3166list - /*106*/ { "[423]004894435894", ZINT_WARN_NONCOMPLIANT, "423004894435894", "261: AI (423) position 7: Unknown country code '435'" }, // iso3166list - /*107*/ { "[423]004433004894", ZINT_WARN_NONCOMPLIANT, "423004433004894", "261: AI (423) position 4: Unknown country code '433'" }, // iso3166list - /*108*/ { "[423]432894004894", ZINT_WARN_NONCOMPLIANT, "423432894004894", "261: AI (423) position 1: Unknown country code '432'" }, // iso3166list - /*109*/ { "[423]004894003", ZINT_WARN_NONCOMPLIANT, "423004894003", "261: AI (423) position 7: Unknown country code '003'" }, // iso3166list - /*110*/ { "[423]004895004", ZINT_WARN_NONCOMPLIANT, "423004895004", "261: AI (423) position 4: Unknown country code '895'" }, // iso3166list - /*111*/ { "[423]004999004", ZINT_WARN_NONCOMPLIANT, "423004999004", "261: AI (423) position 4: Unknown country code '999'" }, // iso3166list - /*112*/ { "[423]003894004", ZINT_WARN_NONCOMPLIANT, "423003894004", "261: AI (423) position 1: Unknown country code '003'" }, // iso3166list - /*113*/ { "[423]004999", ZINT_WARN_NONCOMPLIANT, "423004999", "261: AI (423) position 4: Unknown country code '999'" }, // iso3166list - /*114*/ { "[423]000894", ZINT_WARN_NONCOMPLIANT, "423000894", "261: AI (423) position 1: Unknown country code '000'" }, // iso3166list - /*115*/ { "[423]003", ZINT_WARN_NONCOMPLIANT, "423003", "261: AI (423) position 1: Unknown country code '003'" }, // iso3166list - /*116*/ { "[7030]999A", 0, "7030999A", "" }, // iso3166999 - /*117*/ { "[7030]894A", 0, "7030894A", "" }, // iso3166999 - /*118*/ { "[7030]004A", 0, "7030004A", "" }, // iso3166999 - /*119*/ { "[7030]004", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7030)" }, // iso3166999 - /*120*/ { "[7030]04", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (7030)" }, // iso3166999 - /*121*/ { "[7030]001A", ZINT_WARN_NONCOMPLIANT, "7030001A", "261: AI (7030) position 1: Unknown country code '001'" }, // iso3166999 - /*122*/ { "[7030]998A", ZINT_WARN_NONCOMPLIANT, "7030998A", "261: AI (7030) position 1: Unknown country code '998'" }, // iso3166999 - /*123*/ { "[3910]0081", 0, "39100081", "" }, // iso4217 - /*124*/ { "[3910]9991", 0, "39109991", "" }, // iso4217 - /*125*/ { "[3910]9971", 0, "39109971", "" }, // iso4217 - /*126*/ { "[3910]01", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 - /*127*/ { "[3910]001", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (3910)" }, // iso4217 - /*128*/ { "[3910]9981", ZINT_WARN_NONCOMPLIANT, "39109981", "261: AI (3910) position 1: Unknown currency code '998'" }, // iso4217 - /*129*/ { "[3910]0041", ZINT_WARN_NONCOMPLIANT, "39100041", "261: AI (3910) position 1: Unknown currency code '004'" }, // iso4217 - /*130*/ { "[3910]8941", ZINT_WARN_NONCOMPLIANT, "39108941", "261: AI (3910) position 1: Unknown currency code '894'" }, // iso4217 - /*131*/ { "[4300]%12", 0, "4300%12", "" }, // pcenc - /*132*/ { "[4300]%1", ZINT_WARN_NONCOMPLIANT, "4300%1", "261: AI (4300) position 1: Invalid % escape" }, // pcenc - /*133*/ { "[4300]%", ZINT_WARN_NONCOMPLIANT, "4300%", "261: AI (4300) position 1: Invalid % escape" }, // pcenc - /*134*/ { "[4300]12%1212", 0, "430012%1212", "" }, // pcenc - /*135*/ { "[4300]12%1G12", ZINT_WARN_NONCOMPLIANT, "430012%1G12", "261: AI (4300) position 5: Invalid characters for percent encoding" }, // pcenc - /*136*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", 0, "4308ABCDEFGHIJKLMNOPQRSTUVWXYZ%+12", "" }, // no pcenc - /*137*/ { "[4308]ABCDEFGHIJKLMNOPQRSTUVWXYZ%+123", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (4308)" }, // no pcenc - /*138*/ { "[4321]1", 0, "43211", "" }, // yesno - /*139*/ { "[4321]0", 0, "43210", "" }, // yesno - /*140*/ { "[4321]2", ZINT_WARN_NONCOMPLIANT, "43212", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno - /*141*/ { "[4321]9", ZINT_WARN_NONCOMPLIANT, "43219", "261: AI (4321) position 1: Neither 0 nor 1 for yes or no" }, // yesno - /*142*/ { "[7040]1234", 0, "70401234", "" }, // importeridx - /*143*/ { "[7040]123A", 0, "7040123A", "" }, // importeridx - /*144*/ { "[7040]123Z", 0, "7040123Z", "" }, // importeridx - /*145*/ { "[7040]123a", 0, "7040123a", "" }, // importeridx - /*146*/ { "[7040]123z", 0, "7040123z", "" }, // importeridx - /*147*/ { "[7040]123-", 0, "7040123-", "" }, // importeridx - /*148*/ { "[7040]123_", 0, "7040123_", "" }, // importeridx - /*149*/ { "[7040]123!", ZINT_WARN_NONCOMPLIANT, "7040123!", "261: AI (7040) position 4: Invalid importer index '!'" }, // importeridx - /*150*/ { "[7040]123/", ZINT_WARN_NONCOMPLIANT, "7040123/", "261: AI (7040) position 4: Invalid importer index '/'" }, // importeridx - /*151*/ { "[7040]123:", ZINT_WARN_NONCOMPLIANT, "7040123:", "261: AI (7040) position 4: Invalid importer index ':'" }, // importeridx - /*152*/ { "[7040]123?", ZINT_WARN_NONCOMPLIANT, "7040123?", "261: AI (7040) position 4: Invalid importer index '?'" }, // importeridx - /*153*/ { "[8001]12341234512311", 0, "800112341234512311", "" }, // nonzero - /*154*/ { "[8001]00010000100100", 0, "800100010000100100", "" }, // nonzero - /*155*/ { "[8001]00001234512311", ZINT_WARN_NONCOMPLIANT, "800100001234512311", "261: AI (8001) position 1: Zero not permitted" }, // nonzero - /*156*/ { "[8001]12340000012311", ZINT_WARN_NONCOMPLIANT, "800112340000012311", "261: AI (8001) position 5: Zero not permitted" }, // nonzero - /*157*/ { "[8001]00010000100011", ZINT_WARN_NONCOMPLIANT, "800100010000100011", "261: AI (8001) position 10: Zero not permitted" }, // nonzero - /*158*/ { "[8001]00010000100101", 0, "800100010000100101", "" }, // winding - /*159*/ { "[8001]00010000100111", 0, "800100010000100111", "" }, // winding - /*160*/ { "[8001]00010000100191", 0, "800100010000100191", "" }, // winding - /*161*/ { "[8001]00010000100121", ZINT_WARN_NONCOMPLIANT, "800100010000100121", "261: AI (8001) position 13: Invalid winding direction '2'" }, // winding - /*162*/ { "[8001]00010000100131", ZINT_WARN_NONCOMPLIANT, "800100010000100131", "261: AI (8001) position 13: Invalid winding direction '3'" }, // winding - /*163*/ { "[8001]00010000100171", ZINT_WARN_NONCOMPLIANT, "800100010000100171", "261: AI (8001) position 13: Invalid winding direction '7'" }, // winding - /*164*/ { "[8001]00010000100181", ZINT_WARN_NONCOMPLIANT, "800100010000100181", "261: AI (8001) position 13: Invalid winding direction '8'" }, // winding - /*165*/ { "[8003]01234567890128", 0, "800301234567890128", "" }, // zero - /*166*/ { "[8003]11234567890128", ZINT_WARN_NONCOMPLIANT, "800311234567890128", "261: AI (8003) position 1: Zero is required" }, // zero - /*167*/ { "[8003]91234567890128", ZINT_WARN_NONCOMPLIANT, "800391234567890128", "261: AI (8003) position 1: Zero is required" }, // zero - /*168*/ { "[8006]123456789012310101", 0, "8006123456789012310101", "" }, // pieceoftotal - /*169*/ { "[8006]123456789012310199", 0, "8006123456789012310199", "" }, // pieceoftotal - /*170*/ { "[8006]123456789012319999", 0, "8006123456789012319999", "" }, // pieceoftotal - /*171*/ { "[8006]123456789012310001", ZINT_WARN_NONCOMPLIANT, "8006123456789012310001", "261: AI (8006) position 15: Piece number cannot be zero" }, // pieceoftotal - /*172*/ { "[8006]123456789012310100", ZINT_WARN_NONCOMPLIANT, "8006123456789012310100", "261: AI (8006) position 15: Total number cannot be zero" }, // pieceoftotal - /*173*/ { "[8006]123456789012310201", ZINT_WARN_NONCOMPLIANT, "8006123456789012310201", "261: AI (8006) position 15: Piece number '02' exceeds total '01'" }, // pieceoftotal - /*174*/ { "[8006]123456789012319998", ZINT_WARN_NONCOMPLIANT, "8006123456789012319998", "261: AI (8006) position 15: Piece number '99' exceeds total '98'" }, // pieceoftotal - /*175*/ { "[8007]GB82WEST12345698765432", 0, "8007GB82WEST12345698765432", "" }, // iban - /*176*/ { "[8007]GB83WEST12345698765432", ZINT_WARN_NONCOMPLIANT, "8007GB83WEST12345698765432", "261: AI (8007) position 3: Bad IBAN checksum '83', expected '82'" }, // iban - /*177*/ { "[8007]BE71096123456769", 0, "8007BE71096123456769", "" }, // iban - /*178*/ { "[8007]BE71096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE71096123456760", "261: AI (8007) position 3: Bad IBAN checksum '71', expected '23'" }, // iban - /*179*/ { "[8007]BE01096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE01096123456760", "261: AI (8007) position 3: Bad IBAN checksum '01', expected '23'" }, // iban - /*180*/ { "[8007]BE00096123456760", ZINT_WARN_NONCOMPLIANT, "8007BE00096123456760", "261: AI (8007) position 3: Bad IBAN checksum '00', expected '23'" }, // iban - /*181*/ { "[8007]LC14BOSL123456789012345678901234", 0, "8007LC14BOSL123456789012345678901234", "" }, // iban - /*182*/ { "[8007]LC14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007LC14BOSL123456789012345678901230", "261: AI (8007) position 3: Bad IBAN checksum '14', expected '25'" }, // iban - /*183*/ { "[8007]A114BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007A114BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code 'A1'" }, // iban - /*184*/ { "[8007]1A14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "80071A14BOSL123456789012345678901230", "261: AI (8007) position 1: Non-alphabetic IBAN country code '1A'" }, // iban - /*185*/ { "[8007]AA14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007AA14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'AA'" }, // iban - /*186*/ { "[8007]ZZ14BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZZ14BOSL123456789012345678901230", "261: AI (8007) position 1: Invalid IBAN country code 'ZZ'" }, // iban - /*187*/ { "[8007]ZW33BOSL123456789012345678901230", 0, "8007ZW33BOSL123456789012345678901230", "" }, // iban - /*188*/ { "[8007]ZWA3BOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZWA3BOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum 'A3'" }, // iban - /*189*/ { "[8007]ZW3ABOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW3ABOSL123456789012345678901230", "261: AI (8007) position 3: Non-numeric IBAN checksum '3A'" }, // iban - /*190*/ { "[8007]ZW33bOSL123456789012345678901230", ZINT_WARN_NONCOMPLIANT, "8007ZW33bOSL123456789012345678901230", "261: AI (8007) position 5: Invalid IBAN character 'b'" }, // iban - /*191*/ { "[8007]FR7630006000011234567890189", 0, "8007FR7630006000011234567890189", "" }, // iban - /*192*/ { "[8007]DE91100000000123456789", 0, "8007DE91100000000123456789", "" }, // iban - /*193*/ { "[8007]GR9608100010000001234567890", 0, "8007GR9608100010000001234567890", "" }, // iban - /*194*/ { "[8007]MU43BOMM0101123456789101000MUR", 0, "8007MU43BOMM0101123456789101000MUR", "" }, // iban - /*195*/ { "[8007]PL10105000997603123456789123", 0, "8007PL10105000997603123456789123", "" }, // iban - /*196*/ { "[8007]RO09BCYP0000001234567890", 0, "8007RO09BCYP0000001234567890", "" }, // iban - /*197*/ { "[8007]SA4420000001234567891234", 0, "8007SA4420000001234567891234", "" }, // iban - /*198*/ { "[8007]ES7921000813610123456789", 0, "8007ES7921000813610123456789", "" }, // iban - /*199*/ { "[8007]CH5604835012345678009", 0, "8007CH5604835012345678009", "" }, // iban - /*200*/ { "[8007]GB98MIDL07009312345678", 0, "8007GB98MIDL07009312345678", "" }, // iban - /*201*/ { "[8011]1", 0, "80111", "" }, // nozeroprefix - /*202*/ { "[8011]11", 0, "801111", "" }, // nozeroprefix - /*203*/ { "[8011]0", 0, "80110", "" }, // nozeroprefix - /*204*/ { "[8011]01", ZINT_WARN_NONCOMPLIANT, "801101", "261: AI (8011) position 1: Zero prefix is not permitted" }, // nozeroprefix - /*205*/ { "[8110]106141416543213150110120", 0, "8110106141416543213150110120", "" }, // couponcode (first part of NACAG Appendix C: Example 1 - see test_rss.c test_examples) - /*206*/ { "[8110]012345612345610104123", 0, "8110012345612345610104123", "" }, // couponcode - /*207*/ { "[8110]01234561234561010412", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412", "259: Invalid data length for AI (8110)" }, // couponcode - /*208*/ { "[8110]12345678901234567890", ZINT_WARN_NONCOMPLIANT, "811012345678901234567890", "259: Invalid data length for AI (8110)" }, // couponcode - /*209*/ { "[8110]712345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110712345612345610104123", "261: AI (8110) position 1: Invalid Primary GS1 Co. Prefix VLI '7'" }, // couponcode - /*210*/ { "[8110]A12345612345610104123", ZINT_WARN_NONCOMPLIANT, "8110A12345612345610104123", "261: AI (8110) position 1: Non-numeric Primary GS1 Co. Prefix VLI 'A'" }, // couponcode - /*211*/ { "[8110]012345A12345610104123", ZINT_WARN_NONCOMPLIANT, "8110012345A12345610104123", "261: AI (8110) position 7: Non-numeric Primary GS1 Co. Prefix 'A'" }, // couponcode - /*212*/ { "[8110]012345612345A10104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345A10104123", "261: AI (8110) position 8: Non-numeric Offer Code" }, // couponcode - /*213*/ { "[8110]012345612345600104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345600104123", "261: AI (8110) position 14: Invalid Save Value VLI '0'" }, // couponcode - /*214*/ { "[8110]012345612345660104123", ZINT_WARN_NONCOMPLIANT, "8110012345612345660104123", "261: AI (8110) position 14: Invalid Save Value VLI '6'" }, // couponcode - /*215*/ { "[8110]01234561234561A104123", ZINT_WARN_NONCOMPLIANT, "811001234561234561A104123", "261: AI (8110) position 15: Non-numeric Save Value 'A'" }, // couponcode - /*216*/ { "[8110]012345612345610004123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610004123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '0'" }, // couponcode - /*217*/ { "[8110]012345612345610604123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610604123", "261: AI (8110) position 16: Invalid Primary Purch. Req. VLI '6'" }, // couponcode - /*218*/ { "[8110]0123456123456101A4123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101A4123", "261: AI (8110) position 17: Non-numeric Primary Purch. Req. 'A'" }, // couponcode - /*219*/ { "[8110]012345612345621251234", ZINT_WARN_NONCOMPLIANT, "8110012345612345621251234", "261: AI (8110) position 18: Primary Purch. Req. incomplete" }, // couponcode - /*220*/ { "[8110]012345612345610106123", ZINT_WARN_NONCOMPLIANT, "8110012345612345610106123", "261: AI (8110) position 18: Invalid Primary Purch. Req. Code '6'" }, // couponcode - /*221*/ { "[8110]012345612345610212412", ZINT_WARN_NONCOMPLIANT, "8110012345612345610212412", "261: AI (8110) position 20: Primary Purch. Family Code incomplete" }, // couponcode - /*222*/ { "[8110]0123456123456103123412", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412", "261: AI (8110) position 21: Primary Purch. Family Code incomplete" }, // couponcode - /*223*/ { "[8110]0123456123456103123412A", ZINT_WARN_NONCOMPLIANT, "81100123456123456103123412A", "261: AI (8110) position 21: Non-numeric Primary Purch. Family Code" }, // couponcode - /*224*/ { "[8110]01234561234561031234123", 0, "811001234561234561031234123", "" }, // couponcode - /*225*/ { "[8110]612345678901212345651", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651", "261: AI (8110) position 21: Save Value incomplete" }, // couponcode - /*226*/ { "[8110]6123456789012123456512345", ZINT_WARN_NONCOMPLIANT, "81106123456789012123456512345", "261: AI (8110) position 26: Primary Purch. Req. VLI missing" }, // couponcode - /*227*/ { "[8110]61234567890121234565123455123454123", 0, "811061234567890121234565123455123454123", "" }, // couponcode - /*228*/ { "[8110]61234567890121234565123455123454123A", ZINT_WARN_NONCOMPLIANT, "811061234567890121234565123455123454123A", "261: AI (8110) position 36: Non-numeric Data Field 'A'" }, // couponcode - /*229*/ { "[8110]612345678901212345651234551234541237", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541237", "261: AI (8110) position 36: Invalid Data Field '7'" }, // couponcode - /*230*/ { "[8110]612345678901212345651234551234541238", ZINT_WARN_NONCOMPLIANT, "8110612345678901212345651234551234541238", "261: AI (8110) position 36: Invalid Data Field '8'" }, // couponcode - /*231*/ { "[8110]0123456123456101041231", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231", "261: AI (8110) position 23: Add. Purch. Rules Code incomplete" }, // couponcode - /*232*/ { "[8110]0123456123456101041231A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231A", "261: AI (8110) position 23: Non-numeric Add. Purch. Rules Code" }, // couponcode - /*233*/ { "[8110]01234561234561010412314", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412314", "261: AI (8110) position 23: Invalid Add. Purch. Rules Code '4'" }, // couponcode - /*234*/ { "[8110]01234561234561010412313", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313", "261: AI (8110) position 24: 2nd Purch. Req. VLI missing" }, // couponcode - /*235*/ { "[8110]01234561234561010412313A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313A", "261: AI (8110) position 24: Non-numeric 2nd Purch. Req. VLI 'A'" }, // couponcode - /*236*/ { "[8110]012345612345610104123130", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123130", "261: AI (8110) position 24: Invalid 2nd Purch. Req. VLI '0'" }, // couponcode - /*237*/ { "[8110]012345612345610104123131", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131", "261: AI (8110) position 25: 2nd Purch. Req. incomplete" }, // couponcode - /*238*/ { "[8110]012345612345610104123131A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123131A", "261: AI (8110) position 25: Non-numeric 2nd Purch. Req. 'A'" }, // couponcode - /*239*/ { "[8110]0123456123456101041231310", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310", "261: AI (8110) position 26: 2nd Purch. Req. Code incomplete" }, // couponcode - /*240*/ { "[8110]0123456123456101041231310A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041231310A", "261: AI (8110) position 26: Non-numeric 2nd Purch. Req. Code" }, // couponcode - /*241*/ { "[8110]01234561234561010412313108", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313108", "261: AI (8110) position 26: Invalid 2nd Purch. Req. Code '8'" }, // couponcode - /*242*/ { "[8110]01234561234561010412313100", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100", "261: AI (8110) position 27: 2nd Purch. Family Code incomplete" }, // couponcode - /*243*/ { "[8110]01234561234561010412313100123", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123", "261: AI (8110) position 30: 2nd Purch. GS1 Co. Prefix VLI missing" }, // couponcode - /*244*/ { "[8110]01234561234561010412313100123A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123A", "261: AI (8110) position 30: Non-numeric 2nd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode - /*245*/ { "[8110]012345612345610104123131001239", 0, "8110012345612345610104123131001239", "" }, // couponcode - /*246*/ { "[8110]01234561234561010412313100123012345", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412313100123012345", "261: AI (8110) position 31: 2nd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*247*/ { "[8110]0123456123456101041231310012311234567", 0, "81100123456123456101041231310012311234567", "" }, // couponcode - /*248*/ { "[8110]0123456123456101041232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232", "261: AI (8110) position 23: 3rd Purch. Req. VLI missing" }, // couponcode - /*249*/ { "[8110]0123456123456101041232A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232A", "261: AI (8110) position 23: Non-numeric 3rd Purch. Req. VLI 'A'" }, // couponcode - /*250*/ { "[8110]01234561234561010412326", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412326", "261: AI (8110) position 23: Invalid 3rd Purch. Req. VLI '6'" }, // couponcode - /*251*/ { "[8110]01234561234561010412321", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321", "261: AI (8110) position 24: 3rd Purch. Req. incomplete" }, // couponcode - /*252*/ { "[8110]012345612345610104123210", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210", "261: AI (8110) position 25: 3rd Purch. Req. Code incomplete" }, // couponcode - /*253*/ { "[8110]0123456123456101041232105", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232105", "261: AI (8110) position 25: Invalid 3rd Purch. Req. Code '5'" }, // couponcode - /*254*/ { "[8110]0123456123456101041232104", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104", "261: AI (8110) position 26: 3rd Purch. Family Code incomplete" }, // couponcode - /*255*/ { "[8110]012345612345610104123210412A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123210412A", "261: AI (8110) position 26: Non-numeric 3rd Purch. Family Code" }, // couponcode - /*256*/ { "[8110]0123456123456101041232104123", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123", "261: AI (8110) position 29: 3rd Purch. GS1 Co. Prefix VLI missing" }, // couponcode - /*257*/ { "[8110]01234561234561010412321041230", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412321041230", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*258*/ { "[8110]0123456123456101041232104123A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123A", "261: AI (8110) position 29: Non-numeric 3rd Purch. GS1 Co. Prefix VLI 'A'" }, // couponcode - /*259*/ { "[8110]0123456123456101041232104123012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345", "261: AI (8110) position 30: 3rd Purch. GS1 Co. Prefix incomplete" }, // couponcode - /*260*/ { "[8110]0123456123456101041232104123012345A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041232104123012345A", "261: AI (8110) position 35: Non-numeric 3rd Purch. GS1 Co. Prefix 'A'" }, // couponcode - /*261*/ { "[8110]01234561234561010412321041230123456", 0, "811001234561234561010412321041230123456", "" }, // couponcode - /*262*/ { "[8110]0123456123456101041233", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode - /*263*/ { "[8110]01234561234561010412332012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412332012", "261: AI (8110) position 23: Expiration Date incomplete" }, // couponcode - /*264*/ { "[8110]012345612345610104123320123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123320123A", "261: AI (8110) position 23: Non-numeric Expiration Date" }, // couponcode - /*265*/ { "[8110]0123456123456101041233201232", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233201232", "261: AI (8110) position 27: Invalid day '32'" }, // couponcode - /*266*/ { "[8110]0123456123456101041233200031", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041233200031", "261: AI (8110) position 25: Invalid month '00'" }, // couponcode - /*267*/ { "[8110]0123456123456101041233201231", 0, "81100123456123456101041233201231", "" }, // couponcode - /*268*/ { "[8110]0123456123456101041234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode - /*269*/ { "[8110]01234561234561010412342012", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412342012", "261: AI (8110) position 23: Start Date incomplete" }, // couponcode - /*270*/ { "[8110]012345612345610104123420123A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123420123A", "261: AI (8110) position 23: Non-numeric Start Date" }, // couponcode - /*271*/ { "[8110]0123456123456101041234200230", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234200230", "261: AI (8110) position 27: Invalid day '30'" }, // couponcode - /*272*/ { "[8110]0123456123456101041234201329", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041234201329", "261: AI (8110) position 25: Invalid month '13'" }, // couponcode - /*273*/ { "[8110]0123456123456101041234200229", 0, "81100123456123456101041234200229", "" }, // couponcode - /*274*/ { "[8110]0123456123456101041235", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235", "261: AI (8110) position 23: Serial Number VLI missing" }, // couponcode - /*275*/ { "[8110]0123456123456101041235A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235A", "261: AI (8110) position 23: Non-numeric Serial Number VLI 'A'" }, // couponcode - /*276*/ { "[8110]01234561234561010412350", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412350", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*277*/ { "[8110]0123456123456101041235012345", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235012345", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*278*/ { "[8110]0123456123456101041235912345678901234", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234", "261: AI (8110) position 24: Serial Number incomplete" }, // couponcode - /*279*/ { "[8110]0123456123456101041235912345678901234A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041235912345678901234A", "261: AI (8110) position 38: Non-numeric Serial Number 'A'" }, // couponcode - /*280*/ { "[8110]01234561234561010412359123456789012345", 0, "811001234561234561010412359123456789012345", "" }, // couponcode - /*281*/ { "[8110]0123456123456101041236", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236", "261: AI (8110) position 23: Retailer ID VLI missing" }, // couponcode - /*282*/ { "[8110]0123456123456101041236A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041236A", "261: AI (8110) position 23: Non-numeric Retailer ID VLI 'A'" }, // couponcode - /*283*/ { "[8110]01234561234561010412360", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412360", "261: AI (8110) position 23: Invalid Retailer ID VLI '0'" }, // couponcode - /*284*/ { "[8110]01234561234561010412368", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412368", "261: AI (8110) position 23: Invalid Retailer ID VLI '8'" }, // couponcode - /*285*/ { "[8110]01234561234561010412361", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode - /*286*/ { "[8110]01234561234561010412361123456", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456", "261: AI (8110) position 24: Retailer ID incomplete" }, // couponcode - /*287*/ { "[8110]01234561234561010412361123456A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412361123456A", "261: AI (8110) position 30: Non-numeric Retailer ID 'A'" }, // couponcode - /*288*/ { "[8110]012345612345610104123671234567890123", 0, "8110012345612345610104123671234567890123", "" }, // couponcode - /*289*/ { "[8110]0123456123456101041239", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239", "261: AI (8110) position 23: Save Value Code incomplete" }, // couponcode - /*290*/ { "[8110]0123456123456101041239A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239A", "261: AI (8110) position 23: Non-numeric Save Value Code" }, // couponcode - /*291*/ { "[8110]01234561234561010412393", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412393", "261: AI (8110) position 23: Invalid Save Value Code '3'" }, // couponcode - /*292*/ { "[8110]01234561234561010412394", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412394", "261: AI (8110) position 23: Invalid Save Value Code '4'" }, // couponcode - /*293*/ { "[8110]01234561234561010412397", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412397", "261: AI (8110) position 23: Invalid Save Value Code '7'" }, // couponcode - /*294*/ { "[8110]01234561234561010412390", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390", "261: AI (8110) position 24: Save Value Applies To incomplete" }, // couponcode - /*295*/ { "[8110]01234561234561010412390A", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390A", "261: AI (8110) position 24: Non-numeric Save Value Applies To" }, // couponcode - /*296*/ { "[8110]012345612345610104123903", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123903", "261: AI (8110) position 24: Invalid Save Value Applies To '3'" }, // couponcode - /*297*/ { "[8110]012345612345610104123902", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902", "261: AI (8110) position 25: Store Coupon Flag incomplete" }, // couponcode - /*298*/ { "[8110]012345612345610104123902A", ZINT_WARN_NONCOMPLIANT, "8110012345612345610104123902A", "261: AI (8110) position 25: Non-numeric Store Coupon Flag" }, // couponcode - /*299*/ { "[8110]0123456123456101041239029", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029", "261: AI (8110) position 26: Don't Multiply Flag incomplete" }, // couponcode - /*300*/ { "[8110]0123456123456101041239029A", ZINT_WARN_NONCOMPLIANT, "81100123456123456101041239029A", "261: AI (8110) position 26: Non-numeric Don't Multiply Flag" }, // couponcode - /*301*/ { "[8110]01234561234561010412390292", ZINT_WARN_NONCOMPLIANT, "811001234561234561010412390292", "261: AI (8110) position 26: Invalid Don't Multiply Flag '2'" }, // couponcode - /*302*/ { "[8110]01234561234561010412390291", 0, "811001234561234561010412390291", "" }, // couponcode - /*303*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601522345678961345678990000", ZINT_ERROR_INVALID_DATA, "", "259: Invalid data length for AI (8110)" }, // couponcode (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) - /*304*/ { "[8110]177777776666663100120444101105551888888821109991222222232012314200601", 0, "8110177777776666663100120444101105551888888821109991222222232012314200601", "" }, // couponcode - /*305*/ { "[8112]017777777666666223456789", 0, "8112017777777666666223456789", "" }, // couponposoffer (example from GS1 AI (8112) Coupon Data Specifications Appendix A: AI (8110) vs AI (8112)) - /*306*/ { "[8112]001234561234560123456", 0, "8112001234561234560123456", "" }, // couponposoffer - /*307*/ { "[8112]00123456123456012345", ZINT_WARN_NONCOMPLIANT, "811200123456123456012345", "259: Invalid data length for AI (8112)" }, // couponposoffer - /*308*/ { "[8112]0012345612345601234561", ZINT_WARN_NONCOMPLIANT, "81120012345612345601234561", "261: AI (8112) position 22: Reserved trailing characters" }, // couponposoffer - /*309*/ { "[8112]061234567890121234569123456789012345", 0, "8112061234567890121234569123456789012345", "" }, // couponposoffer - /*310*/ { "[8112]0612345678901212345691234567890123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345691234567890123456", "259: Invalid data length for AI (8112)" }, // couponposoffer - /*311*/ { "[8112]06123456789012123456912345678901234A", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234A", "261: AI (8112) position 36: Non-numeric Serial Number 'A'" }, // couponposoffer - /*312*/ { "[8112]06123456789012123456912345678901234", ZINT_WARN_NONCOMPLIANT, "811206123456789012123456912345678901234", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer - /*313*/ { "[8112]06123456789012123456812345678901234", 0, "811206123456789012123456812345678901234", "" }, // couponposoffer - /*314*/ { "[8112]0612345678901212345681234567890123", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345681234567890123", "261: AI (8112) position 22: Serial Number incomplete" }, // couponposoffer - /*315*/ { "[8112]0612345678901212345A0123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901212345A0123456", "261: AI (8112) position 15: Non-numeric Offer Code" }, // couponposoffer - /*316*/ { "[8112]0612345678901A1234560123456", ZINT_WARN_NONCOMPLIANT, "81120612345678901A1234560123456", "261: AI (8112) position 14: Non-numeric Coupon Funder ID 'A'" }, // couponposoffer - /*317*/ { "[8112]071234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112071234567890121234560123456", "261: AI (8112) position 2: Invalid Coupon Funder ID VLI '7'" }, // couponposoffer - /*318*/ { "[8112]0A1234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "81120A1234567890121234560123456", "261: AI (8112) position 2: Non-numeric Coupon Funder ID VLI 'A'" }, // couponposoffer - /*319*/ { "[8112]261234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112261234567890121234560123456", "261: AI (8112) position 1: Coupon Format must be 0 or 1" }, // couponposoffer - /*320*/ { "[8112]A61234567890121234560123456", ZINT_WARN_NONCOMPLIANT, "8112A61234567890121234560123456", "261: AI (8112) position 1: Non-numeric Coupon Format" }, // couponposoffer + /* 15*/ { "[8013]1987654Ad4X4bL5ttr2310c2K", 0, "80131987654Ad4X4bL5ttr2310c2K", "" }, // csumalpha + /* 16*/ { "[8013]12345678901234567890123NT", 0, "801312345678901234567890123NT", "" }, // csumalpha + /* 17*/ { "[8013]12345_ABCDEFGHIJKLMCP", 0, "801312345_ABCDEFGHIJKLMCP", "" }, // csumalpha + /* 18*/ { "[8013]12345_NOPQRSTUVWXYZDN", 0, "801312345_NOPQRSTUVWXYZDN", "" }, // csumalpha + /* 19*/ { "[8013]12345_abcdefghijklmN3", 0, "801312345_abcdefghijklmN3", "" }, // csumalpha + /* 20*/ { "[8013]12345_nopqrstuvwxyzP2", 0, "801312345_nopqrstuvwxyzP2", "" }, // csumalpha + /* 21*/ { "[8013]12345_!\"%&'()*+,-./LC", 0, "801312345_!\"%&'()*+,-./LC", "" }, // csumalpha + /* 22*/ { "[8013]12345_0123456789:;<=>?62", 0, "801312345_0123456789:;<=>?62", "" }, // csumalpha + /* 23*/ { "[8013]7907665Bm8v2AB", 0, "80137907665Bm8v2AB", "" }, // csumalpha + /* 24*/ { "[8013]97850l6KZm0yCD", 0, "801397850l6KZm0yCD", "" }, // csumalpha + /* 25*/ { "[8013]225803106GSpEF", 0, "8013225803106GSpEF", "" }, // csumalpha + /* 26*/ { "[8013]149512464PM+GH", 0, "8013149512464PM+GH", "" }, // csumalpha + /* 27*/ { "[8013]62577B8fRG7HJK", 0, "801362577B8fRG7HJK", "" }, // csumalpha + /* 28*/ { "[8013]515942070CYxLM", 0, "8013515942070CYxLM", "" }, // csumalpha + /* 29*/ { "[8013]390800494sP6NP", 0, "8013390800494sP6NP", "" }, // csumalpha + /* 30*/ { "[8013]386830132uO+QR", 0, "8013386830132uO+QR", "" }, // csumalpha + /* 31*/ { "[8013]53395376X1:nST", 0, "801353395376X1:nST", "" }, // csumalpha + /* 32*/ { "[8013]957813138Sb6UV", 0, "8013957813138Sb6UV", "" }, // csumalpha + /* 33*/ { "[8013]530790no0qOgWX", 0, "8013530790no0qOgWX", "" }, // csumalpha + /* 34*/ { "[8013]62185314IvwmYZ", 0, "801362185314IvwmYZ", "" }, // csumalpha + /* 35*/ { "[8013]23956qk1&dB!23", 0, "801323956qk1&dB!23", "" }, // csumalpha + /* 36*/ { "[8013]794394895ic045", 0, "8013794394895ic045", "" }, // csumalpha + /* 37*/ { "[8013]57453Uq3qA> def @@ -405,7 +405,7 @@ end -@@ -26524,7 +26708,7 @@ +@@ -26558,7 +26742,7 @@ pop } ifelse @@ -414,7 +414,7 @@ options (lintype) (databaromni) put options (linkage) true put -@@ -26535,7 +26719,7 @@ +@@ -26569,7 +26753,7 @@ linear options //databaromni exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -423,7 +423,7 @@ % Plot the separator /sepfinder { -@@ -26566,20 +26750,66 @@ +@@ -26600,20 +26784,66 @@ sep 0 [0 0 0] putinterval sep sep length 4 sub [0 0 0 0] putinterval 18 sepfinder 64 sepfinder @@ -502,7 +502,7 @@ end -@@ -26637,7 +26867,7 @@ +@@ -26671,7 +26901,7 @@ pop } ifelse @@ -511,7 +511,7 @@ options (lintype) (databarstacked) put options (linkage) true put -@@ -26648,7 +26878,7 @@ +@@ -26682,7 +26912,7 @@ linear options //databarstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -520,7 +520,7 @@ % Plot the separator /sepfinder { -@@ -26676,20 +26906,52 @@ +@@ -26710,20 +26940,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -585,7 +585,7 @@ end -@@ -26747,7 +27009,7 @@ +@@ -26781,7 +27043,7 @@ pop } ifelse @@ -594,7 +594,7 @@ options (lintype) (databarstackedomni) put options (linkage) true put -@@ -26758,7 +27020,7 @@ +@@ -26792,7 +27054,7 @@ linear options //databarstackedomni exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -603,7 +603,7 @@ % Plot the separator /sepfinder { -@@ -26786,20 +27048,52 @@ +@@ -26820,20 +27082,52 @@ sep 0 [ 0 0 0 0 ] putinterval sep sep length 4 sub [ 0 0 0 0 ] putinterval 18 sepfinder @@ -668,7 +668,7 @@ end -@@ -26972,7 +27266,7 @@ +@@ -27006,7 +27300,7 @@ pop } ifelse @@ -677,7 +677,7 @@ options (lintype) (databarlimited) put options (linkage) true put -@@ -26983,7 +27277,7 @@ +@@ -27017,7 +27311,7 @@ linear options //databarlimited exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -686,7 +686,7 @@ % Plot the separator mark -@@ -26991,22 +27285,68 @@ +@@ -27025,22 +27319,68 @@ counttomark 1 sub array astore /sep exch def pop pop sep 0 [0 0 0] putinterval sep sep length 9 sub [0 0 0 0 0 0 0 0 0] putinterval % 4 + 5 right guard spaces @@ -769,7 +769,7 @@ end -@@ -27065,7 +27405,7 @@ +@@ -27099,7 +27439,7 @@ pop } ifelse @@ -778,7 +778,7 @@ options (lintype) (databarexpanded) put options (linkage) true put -@@ -27076,7 +27416,7 @@ +@@ -27110,7 +27450,7 @@ linear options //databarexpanded exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -787,7 +787,7 @@ % Plot the separator /sepfinder { -@@ -27105,20 +27445,60 @@ +@@ -27139,20 +27479,60 @@ 18 98 bot length 13 sub {} for 69 98 bot length 13 sub {} for ] {sepfinder} forall @@ -860,7 +860,7 @@ end -@@ -27176,7 +27556,7 @@ +@@ -27210,7 +27590,7 @@ pop } ifelse @@ -869,7 +869,7 @@ options (lintype) (databarexpandedstacked) put options (linkage) true put -@@ -27187,7 +27567,7 @@ +@@ -27221,7 +27601,7 @@ linear options //databarexpandedstacked exec dup (pixs) get 0 2 index (pixx) get getinterval /bot exch def dup (pixy) get /linheight exch def @@ -878,7 +878,7 @@ % Plot the separator /sepfinder { -@@ -27213,21 +27593,49 @@ +@@ -27247,21 +27627,49 @@ 19 98 bot length 13 sub {} for 70 98 bot length 13 sub {} for ] {sepfinder} forall @@ -941,7 +941,7 @@ end -@@ -27286,7 +27694,7 @@ +@@ -27320,7 +27728,7 @@ pop } ifelse @@ -950,7 +950,7 @@ options (inkspread) (0) put options (dontdraw) true put -@@ -27313,35 +27721,87 @@ +@@ -27347,35 +27755,87 @@ linear << options {} forall >> //gs1-128 exec dup (sbs) get /linsbs exch def dup (bhs) get 0 get 72 mul /linheight exch def @@ -1052,7 +1052,7 @@ end -@@ -28772,3 +29232,183 @@ +@@ -28806,3 +29266,183 @@ % --END ENCODER hibcazteccode-- % --END TEMPLATE-- diff --git a/backend/tests/tools/bwipp_dump.ps.tar.xz b/backend/tests/tools/bwipp_dump.ps.tar.xz index ad403973..8e96ea75 100644 Binary files a/backend/tests/tools/bwipp_dump.ps.tar.xz and b/backend/tests/tools/bwipp_dump.ps.tar.xz differ