Update simple-serialize.md

This commit is contained in:
Justin 2019-04-20 20:57:50 +10:00 committed by GitHub
parent 63bdf95e79
commit a481a4e96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -32,7 +32,7 @@ This is a **work in progress** describing typing, serialization and Merkleizatio
* `"bool"`: `True` or `False` * `"bool"`: `True` or `False`
* `"null"`: `None` * `"null"`: `None`
The type `"null"` is only legal as one of several type in a `union` type. The `"null"` type is only legal as a union sub-type.
### Composite types ### Composite types
@ -108,7 +108,6 @@ serialized_type_index = value.type_index.to_bytes(BYTES_PER_LENGTH_PREFIX, "litt
return serialized_type_index + serialized_bytes return serialized_type_index + serialized_bytes
``` ```
## Deserialization ## Deserialization
Because serialization is an injective function (i.e. two distinct objects of the same type will serialize to different values) any bytestring has at most one object it could deserialize to. Efficient algorithms for computing this object can be found in [the implementations](#implementations). Because serialization is an injective function (i.e. two distinct objects of the same type will serialize to different values) any bytestring has at most one object it could deserialize to. Efficient algorithms for computing this object can be found in [the implementations](#implementations).