Skip to content

Commit e279d62

Browse files
committed
More CAD003 edits
1 parent bc53349 commit e279d62

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

docs/cad/003_encoding/README.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ The two Boolean Values `true` or `false` have the Encodings `0xb1` and `0xb0` re
159159

160160
Note: These Tags are chosen to aid human readability, such that the first hexadecimal digit `b` suggests "binary" or "boolean", and the second hexadecimal digit represents the bit value.
161161

162-
### `0x10` - `0x18` Integer ("SmallInt")
162+
### `0x10` - `0x18` Integer (Long)
163163

164164
```Encoding
165165
0x1n <n bytes of numeric data>
166166
```
167167

168-
A small integer value is encoded by the Tag byte followed by `n` bytes representing the signed 2's complement numeric value of the Integer. The integer must be represented in the minimum possible number of bytes (can be 0 additional bytes for the specific value `0`).
168+
A Long value is encoded by the Tag byte followed by `n` bytes representing the signed two's complement numeric value of the Integer. The Integer MUST be represented in the minimum possible number of bytes - excess leading bytes are an invalid encoding.
169169

170170
Note: The value zero is conveniently encoded in this scheme as the single byte `0x10`
171171

@@ -174,7 +174,7 @@ Note: This encoding is chosen in preference to a VLC encoding because:
174174
- It is consistent with the natural encoding for two's complement integers on most systems
175175
- The numerical part is consistent with the format for BigInts
176176

177-
### `0x19` Integer ("BigInt")
177+
### `0x19` Integer (BigInt)
178178

179179
```
180180
0x19 <VLC Count length of Integer = n> <n bytes of data>
@@ -194,21 +194,6 @@ With the exception of the Tag byte, The encoding of a BigInt is defined to be ex
194194

195195
A Double value is encoded as the Tag byte followed by 8 bytes standard representation of an IEEE 754 double-precision floating point value.
196196

197-
### `0x3c` - `0x3f` Character
198-
199-
```
200-
Tag determines the length in bytes of the Unicode code point value
201-
0x3c <1 Byte>
202-
0x3d <2 Bytes>
203-
0x3e <3 Bytes>
204-
0x3f <4 Bytes> (reserved, not currently possible?)
205-
```
206-
207-
A Character value is encoded by the Tag byte followed by 1-4 bytes representing the Unicode code point as an unsigned integer.
208-
209-
A Character encoding is invalid if:
210-
- More bytes are used than necessary (i.e. a leading byte of zero)
211-
- The code point is beyond the maximum allowable (0x10ffff)
212197

213198
### `0x20` Ref
214199

@@ -305,6 +290,22 @@ A Keyword is encoded with the Tag byte, an unsigned count byte `n`, and `n` byte
305290

306291
The Keyword MUST have a length of 1-128 UTF-8 bytes
307292

293+
### `0x3c` - `0x3f` Character
294+
295+
```
296+
Tag determines the length in bytes of the Unicode code point value
297+
0x3c <1 Byte>
298+
0x3d <2 Bytes>
299+
0x3e <3 Bytes>
300+
0x3f <4 Bytes> (reserved, not currently possible?)
301+
```
302+
303+
A Character value is encoded by the Tag byte followed by 1-4 bytes representing the Unicode code point as an unsigned integer.
304+
305+
A Character encoding is invalid if:
306+
- More bytes are used than necessary (i.e. a leading byte of zero)
307+
- The code point is beyond the maximum allowable (0x10ffff)
308+
308309
### `0x80` Vector
309310

310311
```

0 commit comments

Comments
 (0)