Skip to content

HRI: update AIs to latest gs1-syntax-dictionary.txt #880

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion core/src/HRI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct AiInfo
}
};

// https://github.com/gs1/gs1-syntax-dictionary 2023-09-22
// https://github.com/gs1/gs1-syntax-dictionary 2024-06-10
static const AiInfo aiInfos[] = {
//TWO_DIGIT_DATA_LENGTH
{ "00", 18 },
Expand Down Expand Up @@ -220,6 +220,16 @@ static const AiInfo aiInfos[] = {
{ "7240", -20 },
{ "7241", 2 },
{ "7242", -25 },
{ "7250", 8 },
{ "7251", 12 },
{ "7252", 1 },
{ "7253", -40 },
{ "7254", -40 },
{ "7255", -10 },
{ "7256", -90 },
{ "7257", -70 },
{ "7258", 3 },
{ "7259", -40 },

{ "8001", 14 },
{ "8002", -20 },
Expand Down
6 changes: 6 additions & 0 deletions test/unit/GS1Test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ TEST(HRIFromGS1, Single)
// Too long
EXPECT_EQ(HRIFromGS1("7240123456789012345678901"), "");

// Fixed length
EXPECT_EQ(HRIFromGS1("72581/2"), "(7258)1/2");
// Incorrect lengths
EXPECT_EQ(HRIFromGS1("72581/10"), "");
EXPECT_EQ(HRIFromGS1("725812"), "");

// Max length
EXPECT_EQ(HRIFromGS1("80071234567890123456789012345678901234"), "(8007)1234567890123456789012345678901234");
EXPECT_EQ(HRIFromGS1("8007123456789012345678901234567890123"), "(8007)123456789012345678901234567890123");
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy