Merge branch 'master' into hwwhww/per_block

This commit is contained in:
Hsiao-Wei Wang 2019-01-29 01:49:41 +08:00 committed by GitHub
commit 6bad4ed986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 274 additions and 214 deletions

File diff suppressed because it is too large Load Diff

View File

@ -143,11 +143,8 @@ Lists are a collection of elements of the same homogeneous type.
|:--------------------------------------------|:----------------------------|
| Length of serialized list fits into 4 bytes | ``len(serialized) < 2**32`` |
1. Get the number of raw bytes to serialize: it is ``len(list) * sizeof(element)``.
* Encode that as a `4-byte` **little endian** `uint32`.
2. Append the elements in a packed manner.
* *Note on efficiency*: consider using a container that does not need to iterate over all elements to get its length. For example Python lists, C++ vectors or Rust Vec.
1. Serialize all list elements individually and concatenate them.
2. Prefix the concatenation with its length encoded as a `4-byte` **little-endian** unsigned integer.
**Example in Python**