Skip to content

Commit eabd06e

Browse files
committed
Document that CBOR integers carry no signedness
1 parent fa45d35 commit eabd06e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Documentation/PluginABI.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ Definite-length, integer-keyed CBOR:
9797
```
9898

9999
- Byte fields use a CBOR byte string; UUID fields use tag 37 over a 16-byte string.
100+
- **Integers carry no signedness.** CBOR major type 0 encodes any non-negative integer and major
101+
type 1 any negative one, so a semantically signed field (say a dBm power level) arrives as
102+
`uint` whenever its value is non-negative. The host's `DecodedValue.int` / `.uint` cases
103+
therefore mean "negative" / "non-negative", and they compare and hash numerically — a native
104+
parser emitting `.int(0)` equals a plugin emitting `.uint(0)`. Do not rely on the case to
105+
recover the guest's original type.
100106
- The host decoder is strict: max depth 8, max 64 items per collection, max 1 KiB per string, and
101107
the total output must not exceed the manifest's `maxOutputBytes`.
102108

0 commit comments

Comments
 (0)