-
Notifications
You must be signed in to change notification settings - Fork 19
64-bit integers overflow #1
Comments
Found this other NBT parsing library: https://github.com/maxogden/minecraft-nbt - it also has (about to fix) problems with TAG_Long, but the jdataview https://github.com/jdataview/jdataview library it uses supports 64-bit integers by splitting them into |
That looks like a good solution. You can submit a pull request if you feel like it, otherwise I’ll have a look soon. |
Actually, maybe this should be configurable in some way. It really depends on the consumer what the desired output his. |
Hm, are there really situations where clamped values would be useful? Most 64-bit integers in NBT seem to be some kind of timestamp or identifier, where clamping could be problematic. Rounding would be problematic for identifiers, but possibly useful for timestamps. Maybe |
@sjmulder Found this nifty module https://www.npmjs.org/package/node-int64 - looks like it solves all these problems, let me know what you think. Submitted PR to use this module in #9 |
That looks like a good solution, I’m surprised that the big values can be coerced to numbers. Thanks so much! |
Use node-int64 for 64-bit long integers. Closes GH-1
Values from
TAG_Long
tags may overflow if the value is negative or if it does not fit in 32 bits. This is a limitation of the library used for unpacking binary values.The text was updated successfully, but these errors were encountered: