pyfisch / cbor

CBOR support for serde.
https://docs.rs/serde_cbor/
Apache License 2.0
298 stars 101 forks source link

(De)serialize 128 bit integers #77

Open AregevDev opened 5 years ago

AregevDev commented 5 years ago

The program crashes when trying to serialize them, complaining i/u128 is not supported Serde itself already has support for that

pyfisch commented 5 years ago

AFAIK neither the CBOR RFC 7049 nor an extension in CBOR supports 128 bit numbers. (big decimals are supported by the standard but not by this crate) If you need 128 bit integers I suggest to serialize them as a slice.

AregevDev commented 5 years ago

Oh, didn't know that, started working on PR, never mind

dtolnay commented 5 years ago

The program crashes when trying to serialize them

Is this a crash or does serde_cbor return an error?

AregevDev commented 5 years ago

cbor returns an error

nhynes commented 4 years ago

related: #145

surban commented 3 years ago

MsgPack stores u128/i128 as a byte array. I think it would be a simple fix for serde_cbor to do the same?