forked from hildjj/node-cbor
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
Description
Encoding works fine. But decode fails with
Error: Failed to parse
at Decoder._decode (/home/null/code/js-primea-iframe-container/node_modules/borc/src/decoder.js:565:13)
at Decoder.decodeFirst (/home/null/code/js-primea-iframe-container/node_modules/borc/src/decoder.js:576:10)
at Object.decode (/home/null/code/js-primea-iframe-container/node_modules/borc/src/decoder.js:600:16)
at Object.<anonymous> (/home/null/code/js-primea-iframe-container/examples/ipfstest.js:6:6)
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)
To repodece
const cbor = require('borc')
const fs = require('fs')
const content = fs.readFileSync(__dirname + '/rootContainer.bundle.js').toString()
const encoded = cbor.encode(content)
cbor.decode(encoded)
Where rootContainer.bundle.js
is attached
rootContainer.bundle.js.zip