-
Notifications
You must be signed in to change notification settings - Fork 4
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
ID length normalization #112
Comments
Dear @Echsecutor , I just made some tests, and added the following sample epcs to https://github.com/RalphTro/epcis-event-hash-generator/blob/master/tests/examples/epclist_normalisation.jsonld (see branch 'issue112'):
...into I then executed the code, and it correctly transformed the above into:
So, from my POV, it actually works, any idea why it doesn't work for you? E.g. do you think it makes sense to specifically test it with an XML file? |
I have added an xml example here https://github.com/RalphTro/epcis-event-hash-generator/pull/113/files which to me looks like it doesn't work, i.e. those 3 events lead to 2 different hashes |
Thanks, @Echsecutor , I think I found the reason for this bahaviour in your XML file: But in the third one, the GTIN has another GTIN indicator digit (9 instead of 0): ...and this MUST of course lead to a different hash value. I just noticed that the GTIN as part of the first GS1 DL URI has an incorrect check digit (it must be 04064074123450), the second one is correct though. When canonicalising EPC URNs to GS1 DL URIs, our tool calculates the check digit. And THIS is the reason why the hash value is still different even if you corrected the EPC URN. The pre-hash string has the correct check digit (0) after canonicalising the EPC URN, while event 1 + 2 still have the incorrect ones. So, again, it is correct that our implementation returns different hash values. Now, the interesting question is: does our implementation needs to check each and every identifier populating the epc/quantityLists? This would go beyond of what is specified in the CBV. What is your view on this? Hope this helps/clarified your question? Kind regards, |
Ahh... so this eventually is a typo in my test data and actually the normalization is already in place. Big sorry for wasting your time on this one @RalphTro ! I do not think that validating correct inputs (such as check digits) is within the scope of this hash generater reference implementation. Though it would help with stupid user errors ... ;) |
Dear @Echsecutor , |
Currently the DL normalization of GS1 IDs does not take length differences (leading zeros) into account.
I added an example for an event which uses some id, e.g.
and the same event writing the same id as
This currently leads to different hashes, but in my oppinion should not
See the failing test in #113
The text was updated successfully, but these errors were encountered: