Code Monkey home page Code Monkey logo

Comments (7)

harriha avatar harriha commented on June 20, 2024 1

Hi, thanks for the superfast fix, appreciated!

However, I'm afraid there's still some issues here with GIAI-96:

> const t = tds.fromTagURI("urn:epc:tag:giai-96:0.1234567.30000000004214215")
undefined
> t.toTagURI()
'urn:epc:tag:giai-96:0.1234567.30000000004214215'
> t.toHexString()
'34144B5A1C6A94D74F834DC7'
> t.getAssetReference()
30000000004214216
> t.getGiai()
'123456730000000004214216'

The toTagURI() and toHexString() produce correct output now, but the getAssetReference() and getGiai() don't. If I'm seeing correctly, the fix was fully applied to GIAI-202 but in GIAI-96 these functions are still using the .getSegment() which produces incorrect results?

from epc-tds.

sergiss avatar sergiss commented on June 20, 2024

Hello, thank you very much for your contribution, you are correct, in that case, the decoding should be done using BigInt. I have prepared a solution for the problem that I will post between today and tomorrow. Thanks again, regards!

from epc-tds.

sergiss avatar sergiss commented on June 20, 2024

I have updated the library (v.1.3.2) , and now your code should work correctly. If you detect any malfunctions, I would appreciate it if you could notify me. Regards.

from epc-tds.

sergiss avatar sergiss commented on June 20, 2024

😅 I apologize, it was overlooked. I have created a new version (v.1.3.3) with the problem solved, thank you for your contribution.

from epc-tds.

harriha avatar harriha commented on June 20, 2024

Thanks! Those getAssetReference() and getGiai() seem to work now with GIAI-96, great.

One observation though: the GIAI-96.getAssetReference() returns a BigInt but GIAI-202.getAssetReference() returns a string now. Not sure which one was your target, but would probably be good to have identical return values in these.

On a related note, I guess these changes to the return types are likely to lead to issues if someone is using these functions and they blindly update the lib version to latest. Just stating this out loud as a heads-up, hopefully no major issues arise from these changes as a side effect.

from epc-tds.

sergiss avatar sergiss commented on June 20, 2024

In the case of GIAI-96.getAssetReference(), a BigInt is returned because it is the only way to represent the values stored with that length. In the case of GIAI-202.getAssetReference(), a string is returned because in this case, alpha-numeric values are allowed. In this case, the user will need to be knowledgeable about the standards and handle the values correctly. Regards!

from epc-tds.

harriha avatar harriha commented on June 20, 2024

In the case of GIAI-96.getAssetReference(), a BigInt is returned because it is the only way to represent the values stored with that length. In the case of GIAI-202.getAssetReference(), a string is returned because in this case, alpha-numeric values are allowed. In this case, the user will need to be knowledgeable about the standards and handle the values correctly. Regards!

Ah, of course, thanks for the clarification, the limits of my knowledge about the different formats were already met it seems. But thanks a lot for the quick support with this issue, cheers!

from epc-tds.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.