Skip to content
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

Bignum support #5

Closed
shamblett opened this issue Aug 15, 2018 · 8 comments
Closed

Bignum support #5

shamblett opened this issue Aug 15, 2018 · 8 comments

Comments

@shamblett
Copy link
Owner

Review the support for bignums in the package, at the moment these are supported only through tags

@nailgilaziev
Copy link

How to work with timestamps?
If Map contains this:
6: 1579254859548 //milliseconds
Bignums not supported message occurs in log.

@shamblett
Copy link
Owner Author

This looks like a bug, timestamps aren't bignums, that said things have moved on since this package was released, Dart does now support bignums, this area needs to be addressed.

@shamblett
Copy link
Owner Author

OK, bignum encoding support now added, there is a writeBignum encoder method that takes a BigInt and the writeInt method now automativcally encodes to a bignum if the integer value is large enough.
Yo can now use the new builder classes to encode lists and maps with complex types, refer to issue 10.

Package re published at version 3.1.0

@levifeldman
Copy link
Contributor

Hello, Gratitude for this library.
It might just be on my computer but when trying to write an Int which is greater that 2^32 but less than 2^64 (Uint64) I see the class is using the final int two64-variable in the cbor_constants.dart-file, set to: pow(2,64). When i try to print(pow(2,64)) in a test file. i get the value: 0. This means that this library is coding ints that are greater than 2^32 and less than 2^64 as a BigNum in the stead of coding them as a Uint64.

@shamblett
Copy link
Owner Author

OK I'll have a look at this.

@shamblett
Copy link
Owner Author

I think I've got a solution for this, I've updated the unit tests and all is passing OK. I'll just do some final checks and hopefully re publish the package shortly.

@levifeldman
Copy link
Contributor

Awesome.

@shamblett
Copy link
Owner Author

OK< I still have some concerns about negative bignum handling but I think your uint64 problem has been fixed. I've re published the package at version 4.0.2, please upgrade and re test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants