mirror of
https://github.com/TxtDot/dalet.git
synced 2024-12-25 20:23:44 +03:00
doc: update array data format, add mime type, change style of diagrams
This commit is contained in:
parent
a0f68c4a42
commit
90db2e6c73
1 changed files with 53 additions and 73 deletions
|
@ -2,27 +2,30 @@
|
|||
|
||||
DaletPack is an binary data format for Dalet, that is used for minimizing the size of transmitted daletl data. DaletPack is designed specifically to transfer as little data as possible, it compresses the declaration of tag types into the smallest possible volume. Nothing unnecessary is transferred.
|
||||
|
||||
All data must be compressed in [Zstandard](https://datatracker.ietf.org/doc/html/rfc8878) format.
|
||||
All data must be compressed with [zstd](https://datatracker.ietf.org/doc/html/rfc8878).
|
||||
|
||||
Root data format is array of tags (see [Daletl specification](./daletl.md)), each element reads sequentially without type and size definition.
|
||||
Root data format is array of tags (see [daletl specification](./daletl.md)), each element reads sequentially. Type definition for root is not needed.
|
||||
|
||||
## Types (16)
|
||||
Mime type: `application/dalet-pack`
|
||||
|
||||
## Types
|
||||
|
||||
- **Null**
|
||||
- **Integer**
|
||||
- **String** (6)
|
||||
- **Array** (5)
|
||||
- **Tags** (3)
|
||||
- **Tag only with id**
|
||||
- **Tag with id and body**
|
||||
- **Tag with id, body and argument**
|
||||
- **String** (5)
|
||||
- **Tag array**
|
||||
- **Tags** (4)
|
||||
- **Tag (id)**
|
||||
- **Tag (id, body)**
|
||||
- **Tag (id, argument)**
|
||||
- **Tag (id, body, argument)**
|
||||
|
||||
## Limitations
|
||||
|
||||
- a value of integer (4 bits) must be between 0 and 15
|
||||
- maximum byte size of a String object is (2^32)-1
|
||||
- maximum byte size of a String object is (2^32)
|
||||
- string must be encoded in UTF-8
|
||||
- maximum number of elements of an Array object is (2^32)-1
|
||||
- maximum number of elements of a tag array object is (2^32)
|
||||
|
||||
## Formats
|
||||
|
||||
|
@ -37,11 +40,8 @@ Root data format is array of tags (see [Daletl specification](./daletl.md)), eac
|
|||
| str 8 | 4 | 0100 |
|
||||
| str 16 | 5 | 0101 |
|
||||
| str 32 | 6 | 0110 |
|
||||
| arr 3 | 7 | 0111 |
|
||||
| arr 4 | 8 | 1000 |
|
||||
| arr 8 | 9 | 1001 |
|
||||
| arr 16 | 10 | 1010 |
|
||||
| arr 32 | 11 | 1011 |
|
||||
| tag array | 7 | 0111 |
|
||||
| tag array end | no | 10 |
|
||||
| tag (id) | 12 | 1100 |
|
||||
| tag (id, body) | 13 | 1101 |
|
||||
| tag (id, argument) | 14 | 1110 |
|
||||
|
@ -85,84 +85,64 @@ variable number of objects stored in DaletPack format:
|
|||
### String format
|
||||
|
||||
```txt
|
||||
str 3 (up to 7 bytes):
|
||||
+--------+-----+========+
|
||||
| 0010 | XXX | data |
|
||||
str 3 (up to 8 bytes):
|
||||
+--------+-----+=========+
|
||||
| 0010 | XXX | utf-8 |
|
||||
+--------+-----+========+
|
||||
|
||||
str 4 (up to 15 bytes):
|
||||
+--------+------+========+
|
||||
| 0011 | XXXX | data |
|
||||
+--------+------+========+
|
||||
str 4 (up to 16 bytes):
|
||||
+--------+------+=========+
|
||||
| 0011 | XXXX | utf-8 |
|
||||
+--------+------+=========+
|
||||
|
||||
str 8 (up to 255 bytes):
|
||||
+--------+----------+========+
|
||||
| 0100 | XXXXXXXX | data |
|
||||
+--------+----------+========+
|
||||
str 8 (up to 256 bytes):
|
||||
+--------+----------+=========+
|
||||
| 0100 | XXXXXXXX | utf-8 |
|
||||
+--------+----------+=========+
|
||||
|
||||
str 16 (up to 2^16-1 bytes):
|
||||
+--------+----------+----------+========+
|
||||
| 0101 | XXXXXXXX | XXXXXXXX | data |
|
||||
+--------+----------+----------+========+
|
||||
str 16 (up to 2^16 bytes):
|
||||
+--------+----------+----------+=========+
|
||||
| 0101 | XXXXXXXX | XXXXXXXX | utf-8 |
|
||||
+--------+----------+----------+=========+
|
||||
|
||||
str 32 (up to 2^32-1 bytes):
|
||||
+--------+----------+----------+----------+----------+========+
|
||||
| 0110 | XXXXXXXX | XXXXXXXX | XXXXXXXX | XXXXXXXX | data |
|
||||
+--------+----------+----------+----------+----------+========+
|
||||
str 32 (up to 2^32 bytes):
|
||||
+--------+----------+----------+----------+----------+=========+
|
||||
| 0110 | XXXXXXXX | XXXXXXXX | XXXXXXXX | XXXXXXXX | utf-8 |
|
||||
+--------+----------+----------+----------+----------+=========+
|
||||
```
|
||||
|
||||
### Array format
|
||||
### Tag array format
|
||||
|
||||
```txt
|
||||
arr 3 (up to 7 elements):
|
||||
+--------+-----+~~~~~~~~+
|
||||
| 0111 | XXX | data |
|
||||
+--------+-----+~~~~~~~~+
|
||||
|
||||
arr 4 (up to 15 elements):
|
||||
+--------+------+~~~~~~~~+
|
||||
| 1000 | XXXX | data |
|
||||
+--------+------+~~~~~~~~+
|
||||
|
||||
arr 8 (up to 255 elements):
|
||||
+--------+----------+~~~~~~~~+
|
||||
| 1001 | XXXXXXXX | data |
|
||||
+--------+----------+~~~~~~~~+
|
||||
|
||||
arr 16 (up to 2^16-1 elements):
|
||||
+--------+----------+----------+~~~~~~~~+
|
||||
| 1010 | XXXXXXXX | XXXXXXXX | data |
|
||||
+--------+----------+----------+~~~~~~~~+
|
||||
|
||||
arr 32 (up to 2^32-1 elements):
|
||||
+--------+----------+----------+----------+----------+~~~~~~~~+
|
||||
| 1011 | XXXXXXXX | XXXXXXXX | XXXXXXXX | XXXXXXXX | data |
|
||||
+--------+----------+----------+----------+----------+~~~~~~~~+
|
||||
tag array:
|
||||
+--------+~~~~~~~~~~~~+------+
|
||||
| 0111 | elements | 10 |
|
||||
+--------+~~~~~~~~~~~~+------+
|
||||
```
|
||||
|
||||
### Tag format
|
||||
|
||||
```txt
|
||||
|
||||
Y = tag_id = XXXXX (5 bits) (can change before release)
|
||||
id = XXXXX (5 bits) (can change before release)
|
||||
|
||||
tag (id):
|
||||
+--------+---+
|
||||
| 1100 | Y |
|
||||
+--------+---+
|
||||
+--------+----+
|
||||
| 1100 | id |
|
||||
+--------+----+
|
||||
|
||||
tag (id, body):
|
||||
+--------+---+~~~~~~~~+
|
||||
| 1101 | Y | body |
|
||||
+--------+---+~~~~~~~~+
|
||||
+--------+----+~~~~~~~~+
|
||||
| 1101 | id | body |
|
||||
+--------+----+~~~~~~~~+
|
||||
|
||||
tag (id, argument):
|
||||
+--------+---+~~~~~~~~~~~~+
|
||||
| 1101 | Y | argument |
|
||||
+--------+---+~~~~~~~~~~~~+
|
||||
+--------+----+~~~~~~~~~~~~+
|
||||
| 1110 | id | argument |
|
||||
+--------+----+~~~~~~~~~~~~+
|
||||
|
||||
tag (id, body, argument):
|
||||
+--------+---+~~~~~~~~+~~~~~~~~~~~~+
|
||||
| 1111 | Y | data | argument |
|
||||
+--------+---+~~~~~~~~+~~~~~~~~~~~~+
|
||||
+--------+----+~~~~~~~~+~~~~~~~~~~~~+
|
||||
| 1111 | id | body | argument |
|
||||
+--------+----+~~~~~~~~+~~~~~~~~~~~~+
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue