serde_cbor_core
This is a Serde implementation for CBOR Core. It provides a deterministic encoding for CBOR, detailed Section 4.2.1. of RFC 8949 and expanded on in the IETF draft for CBOR Core.
Deterministic encoding means the same CBOR will be encoded the same way, every time. This is useful when signing or hashing data, since it guarantees the same data will produce the same hash/sig.
The underlying library for CBOR encoding/decoding is cbor4ii and the Serde implementation is also heavily based on their code.
This crate started as a fork of serde_ipld_dagcbor. Many thanks to everyone involved there.
Usage
Storing and loading Rust types is easy and requires only minimal modifications to the program code.
use ;
use Error;
use File;
use BufReader;
// Types annotated with `Serialize` can be stored as DAG-CBOR.
// To be able to load them again add `Deserialize`.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.