On behalf of Nomadic Labs, I’m pleased to announce the first public release of
data-encoding: a library to encode and decode values to JSON or binary format.
data-encoding provides fine grained control over the representation of the data, documentation generation, and detailed encoding/decoding errors.
In the Tezos project, we use
data-encoding for binary serialisation and deserialisation of data transported via the P2P layer and for JSON serialisation and deserialisation of configuration values stored on disk.
The library is available through opam (
opam install data-encoding), hosted on Gitlab (https://gitlab.com/nomadic-labs/data-encoding), and distributed under MIT license.
This release was only possible following an effort to refactor our internal tools and libraries. Most of the credit for this effort goes to Pietro Abate and Pierre Boutillier. Additional thanks to Gabriel Scherer who discovered multiple bugs and contributed the original crowbar tests.
Planned future improvements of the library include:
- splitting the library into smaller components (to minimise dependencies when using only a part of the library), and
- providing multiple endianness (currently the library only provides big-endian binary encodings).