Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions BinaryEncoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ represented by _at most_ ceil(_N_/7) bytes that may contain padding `0x80` or `0

Note: Currently, the only sizes used are `varint7`, `varint32` and `varint64`.

### Non-canonical LEB128

Both `varuintN` and `varintN` can be encoded with *non-canonical* LEB128 values where:

* non-relevant zero `0x80` bytes are present in an over-large encoding; and / or
* non-relevant LEB128 bits (bits past the size) are ignored.

The total number of bytes used to encode the `varuintN` / `varintN` cannot exceed the largest *canonical* encoding for that `varuintN` / `varintN`.

## Language Types

All types are distinguished by a negative `varint7` values that is the first byte of their encoding (representing a type constructor):
Expand Down