You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cad/003_encoding/README.md
+19-18Lines changed: 19 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,13 +159,13 @@ The two Boolean Values `true` or `false` have the Encodings `0xb1` and `0xb0` re
159
159
160
160
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.
161
161
162
-
### `0x10` - `0x18` Integer ("SmallInt")
162
+
### `0x10` - `0x18` Integer (Long)
163
163
164
164
```Encoding
165
165
0x1n <n bytes of numeric data>
166
166
```
167
167
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.
169
169
170
170
Note: The value zero is conveniently encoded in this scheme as the single byte `0x10`
171
171
@@ -174,7 +174,7 @@ Note: This encoding is chosen in preference to a VLC encoding because:
174
174
- It is consistent with the natural encoding for two's complement integers on most systems
175
175
- The numerical part is consistent with the format for BigInts
176
176
177
-
### `0x19` Integer ("BigInt")
177
+
### `0x19` Integer (BigInt)
178
178
179
179
```
180
180
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
194
194
195
195
A Double value is encoded as the Tag byte followed by 8 bytes standard representation of an IEEE 754 double-precision floating point value.
196
196
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)
212
197
213
198
### `0x20` Ref
214
199
@@ -305,6 +290,22 @@ A Keyword is encoded with the Tag byte, an unsigned count byte `n`, and `n` byte
305
290
306
291
The Keyword MUST have a length of 1-128 UTF-8 bytes
307
292
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)
0 commit comments