dignifiedquire / borc

Assimilate your JavaScript objects into cbor
https://dignifiedquire.github.io/borc
MIT License
31 stars 22 forks source link

Error: Undeterminated nesting #40

Open codefrau opened 5 years ago

codefrau commented 5 years ago

This array does not survive an encode-decode roundtrip:

var array = [90,173,127,166,6,31,120,100,46,152,174,201,155,
230,196,27,129,226,247,145,216,131,118,238,94,134,154,16,248,243,175,163,
22,89,96,179,161,220,197,54,151,59,112,199,252,159,176,105,88,15,103,221,
101,121,242,189,11,69,53,4,13,203,30,97,192,68,83,233,231,240,58,210,207,
246,191,12,208,32,93,217,184,91,167,114,55,81,19,60,104,168,36,87,194,0,178,
72,136,150,108,236,51,172,254,5,123,71,43,137,148,23,146,73,200,2,244,139,
206,188,133,249,225,18,212,20,74,48,170,180,160,34,17,76,33,49,28,250,214,
132,195,229,140,171,255,187,157,147,56,153,253,37,215,61,45,158,135,115,41,
21,7,209,234,219,26,98,38,239,24,86,185,85,213,14,122,190,143,40,107,95,109,
228,92,222,251,198,169,10,186,25,117,245,164,106,75,125,79,128,142,67,149,
80,99,63,1,29,181,237,9,35,182,57,66,223,156,52,193,65,177,50,44,138,205,218,
241,102,202,235,124,165,47,8,77,227,232,183,39,144,116,126,224,62,42,84,162,
111,211,130,82,113,204,78,119,3,70,141,110,64];

borc.decode(borc.encode(array));

results in

Error: Undeterminated nesting
    at Decoder._decode (decoder.js:465)
    at Decoder.decodeFirst (decoder.js:481)
    at Object.decode (decoder.js:499)
dignifiedquire commented 5 years ago

Interesting, is the data in the array encdoded cbor in some form by any chance?

codefrau commented 5 years ago

IIRC it's an entropy pool of our random number generator.

b1ek commented 1 year ago

Same issue here