Skip to content

Commit

Permalink
Merge pull request #40 from Cynerd/chainpack-fixs
Browse files Browse the repository at this point in the history
chainpack: fix invalid identification bytes in representations
  • Loading branch information
fvacek authored Jul 23, 2024
2 parents 9d947d4 + da5edff commit 295f8bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/chainpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ formats are defined:
| 129 | 81 | 10000001 | UInt |
| 130 | 82 | 10000010 | Int |
| 131 | 83 | 10000011 | Double |
| 132 | 84 | 10000100 | Bool |
| 133 | 85 | 10000101 | Blob |
| 134 | 86 | 10000110 | String |
| 136 | 88 | 10001000 | List |
Expand Down Expand Up @@ -231,7 +230,7 @@ number of data bytes. The data should be sent in little-endian.

```
+------+--- ---+--- ---+
| 0x84 | UInt length | Data bytes |
| 0x85 | UInt length | Data bytes |
+------+--- ---+--- ---+
```

Expand Down Expand Up @@ -344,7 +343,7 @@ last pair must be followed by **TERM** (`0xff`) that terminates the **Map**.

```
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
| 0x88 | String key 1 | Value 1 | ... | String key n | Value n | 0xff |
| 0x89 | String key 1 | Value 1 | ... | String key n | Value n | 0xff |
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
```

Expand All @@ -363,7 +362,7 @@ pair must be followed by **TERM** (`0xff`) that terminates the **IMap**.

```
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
| 0x88 | Int key 1 | Value 1 | ... | Int key n | Value n | 0xff |
| 0x8a | Int key 1 | Value 1 | ... | Int key n | Value n | 0xff |
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
```

Expand All @@ -378,3 +377,9 @@ Notice that keys are of type **Int** not **UInt**!
### MetaMap
Encoded like **Map** and **IMap** but with keys being both **Int** and
**String**.

```
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
| 0x8b | Int or String key 1 | Value 1 | ... | Int or String key n | Value n | 0xff |
+------+--- ---+--- ---+-- --+--- ---+--- ---+------+
```
2 changes: 1 addition & 1 deletion src/rpcvalue.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ over (such as String and CString in ChainPack converging to just String in CPON,
or CPON's HexBlob and Blob converting to ChainPack's Blob).
hexadecimal numbers

## Some RpcValue examples in Cpon
## Some examples in Cpon

Utf8 string with meta-information about its format.
```
Expand Down

0 comments on commit 295f8bc

Please sign in to comment.