JuliaIO / CBOR.jl

A Concise Binary Object Representation (RFC 7049) serialization library in Julia
MIT License
19 stars 13 forks source link

There seems to be a problem with the handling of signed numbers #20

Open Lo-Dyih-Yuaan opened 2 years ago

Lo-Dyih-Yuaan commented 2 years ago

As far as I understand, in RFC 8949, only NEGATIVE numbers are serialized as Type1, but in this implementation, all signed numbers are serialized as type1. I found this problem when I tried to convertb to Python by cbor2.

Lo-Dyih-Yuaan commented 2 years ago

As a example

julia> CBOR.encode(1::Int64)
9-element Vector{UInt8}:
 0x3b
 0xff
 0xff
 0xff
 0xff
 0xff
 0xff
 0xff
 0xfe