AACEngineering / epcpy-tools

Library for encoding/decoding and representing GS1 Electronic Product Codes
Other
5 stars 2 forks source link

missmatch check digit #2

Closed rG2ee closed 2 years ago

rG2ee commented 2 years ago

Hi, at first thanks for your great effort to write this library! I just installed it and it works like a charm. However I noticed a minor missmatch to a website I found. For the GRAI-170 Tag from your tests I found that decode_epc("0x37012a05f20000188000000000000000000000000000").barcode == '8003032000000000011' decode_epc("0x37012a05f20000188000000000000000000000000000").values['serial_number'] == '1' With a serial number of '1' the second last digit is the check digit which is '1'. When inserting this to http://convert.erfideo.com/Home all values but the check digit (which is 9 on this website) does match.

May you explain weather the website yields wrong values or this a bug in the code?

Many Regards Dennis

Edit1: Additionally the convert.erfideo.com truncates the epc_hex by one trailing '0'. Why are there different lenghts?

Edit2: Updated link.

kluchrj commented 2 years ago

Using GS1's official tool I am getting a 1 for the check digit: https://www.gs1.org/services/epc-encoderdecoder

image

This other online converter also returned 1 for the check digit when I entered the EPC.

I am leaning towards saying that the erfideo website is doing something wrong here. I didn't actually open up the GS1 spec and hand calculate the value from that, but I think it's a pretty safe assumption since it doesn't agree with 3 other implementations.

rG2ee commented 2 years ago

Ok, thanks for the detailed response! It is good to know that there are several such tools for comparison. Shall I close this issue then?

kluchrj commented 2 years ago

I think it's safe to close it.