Open astanciu opened 11 months ago
I'm sing cbor-web and another library (cose-js) which uses cbor, and notice some issues packing between the two. I've narrowed down the issue to this:
const cbor = require("cbor"); const cborWeb = require("cbor-web"); const data = cborWeb.encode('hello') // Uint8Array const encoded = cbor.encode(data) // Buffer const decoded = cbor.decode(encoded) // ByteObject -> {0: 101, 1:104, etc...} // which causes this to fail const dataDecoded = cborWeb.decode(decoded)
Not sure what's going on here, is this something I can address on my side in some way?
It's likely different values for the preferWeb setting. true gets you Uint8Array. false gets you Buffer. ByteObject is likely some weird webpack'd version of Buffer.
preferWeb
true
false
ByteObject
I'm sing cbor-web and another library (cose-js) which uses cbor, and notice some issues packing between the two. I've narrowed down the issue to this:
Not sure what's going on here, is this something I can address on my side in some way?