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

Fails to decode arrays with over 255 elements #20

Closed
wanderer opened this issue Jul 27, 2017 · 3 comments
Closed

Fails to decode arrays with over 255 elements #20

wanderer opened this issue Jul 27, 2017 · 3 comments

Comments

@wanderer
Copy link

wanderer commented Jul 27, 2017

Fails to decode arrays with over 255 elements with the following

/home/null/code/borc/src/decoder.js:561
        throw new Error('Undeterminated nesting')
        ^

Error: Undeterminated nesting
    at Decoder._decode (/home/null/code/borc/src/decoder.js:561:15)
    at Decoder.decodeFirst (/home/null/code/borc/src/decoder.js:577:10)
    at Object.<anonymous> (/home/null/code/js-primea-iframe-container/examples/ipfstest.js:18:5)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)

source

content = Array(256).fill(0)
const encoded = cbor.encode(content)
const dec = new cbor.Decoder()
dec.decodeFirst(encoded)
@dignifiedquire
Copy link
Owner

Turns out I had the wrong return code for array_16. Sorry about that, should be fixed in #21

@wanderer
Copy link
Author

awesome!

@wanderer
Copy link
Author

oh maybe i should wait to close until merged :P

@wanderer wanderer reopened this Jul 28, 2017
dignifiedquire added a commit that referenced this issue Jul 28, 2017
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