kriszyp/cbor-x

RangeError while decoding with `largeBigIntToFloat: true,` enabled

Opened this issue · 5 comments

image - with this code i still get error while trying to decode data. Full error RangeError: 3866570211328656136252311744600662103021 was too large to fit in CBOR 64-bit integer format, set largeBigIntToFloat to convert to float-64.

Also i see that in decode.js there is not keyword like largeBigIntToFloat

Nice lib!!! Fuck this shit

I don't understand how to reproduce this. The reported error is an encoding error, but the image of a code sample above only shows decoding, and is not itself a reproducible code sample. Do you have a specific code sample that can be executed that shows the problem?

no i dont have , i know that this happens for values of big objects. @kriszyp

Thats like full error

RangeError: 4063412740216055739805618382074543969456 was too large to fit in CBOR 64-bit integer format, set largeBigIntToFloat to convert to float-64
bot:start:     at encode (file:///workspace/node_modules/cbor-x/encode.js:588:13)
bot:start:     at file:///workspace/node_modules/cbor-x/encode.js:645:7
bot:start:     at encode (file:///workspace/node_modules/cbor-x/encode.js:472:7)
bot:start:     at file:///workspace/node_modules/cbor-x/encode.js:645:7
bot:start:     at encode (file:///workspace/node_modules/cbor-x/encode.js:472:7)
bot:start:     at file:///workspace/node_modules/cbor-x/encode.js:645:7
bot:start:     at encode (file:///workspace/node_modules/cbor-x/encode.js:472:7)
bot:start:     at Encoder.encode (file:///workspace/node_modules/cbor-x/encode.js:183:5)
bot:start:     at LogUpdateEvent (file:///workspace/apps/bot/dist/functions/Logs.js:43:63)
bot:start:     at messageUpdateLog (file:///workspace/apps/bot/dist/events/messages/messageUpdate.js:14:15)

And the 4063412740216055739805618382074543969456 is value of discord avatar hashe

Using "cbor-x": "^1.5.4" version