shanewholloway / js-cbor-codec

CBOR Codec for NodeJS and the Web.
https://shanewholloway.github.io/js-cbor-codec/
BSD 2-Clause "Simplified" License
5 stars 0 forks source link

BigInt support? #11

Open rpbouman opened 4 months ago

rpbouman commented 4 months ago

I tried:

cbor_decode( cbor_encode(1n))

but it returns an empty object for me. Is that intended? If so, what is the right way to encode/decode bigint values?

shanewholloway commented 4 months ago

Thanks for the question. You are correct that cbor-codec does not yet support BigInt, and I'd love to add it. RFC 8949 has Bignums implementation details to support it directly.

I'd gladly look at a PR to implement.

rpbouman commented 4 months ago

Hi Shane, thanks for the reply. I'm currently still in the "shopping phase" for an exchange format. Right now I'm not ready to commit to a contribution. Sorry! I just thought it would be good to clear that up. I might come back to cbor and reconsider.