Describe the bug
The CBOR UByteArraySerializer encodes as signed bytes rather than unsigned. Only tested with UByteArraySerializer but may affect other unsigned encoding.
To Reproduce
Cbor.encodeToHexString(UByteArraySerializer(), ubyteArrayOf(208u))
.also(::println)
Expected behavior
Which cbor.me shows as:
9F # array(*)
18 D0 # unsigned(208)
FF # primitive(*)
Actual behavior
Which cbor.me shows as:
9F # array(*)
38 2F # negative(47)
FF # primitive(*)
Environment
- Kotlin version: 2.3.20
- Library version: 1.11.0
- Kotlin platforms tested on: JVM, JS, MacOS ARM64, WASM
- Gradle version: 9.4.0
Describe the bug
The CBOR
UByteArraySerializerencodes as signed bytes rather than unsigned. Only tested withUByteArraySerializerbut may affect other unsigned encoding.To Reproduce
Expected behavior
Which cbor.me shows as:
Actual behavior
Which cbor.me shows as:
Environment