| Crates.io | cbor_next |
| lib.rs | cbor_next |
| version | 0.3.0 |
| created_at | 2025-06-13 12:52:05.364932+00 |
| updated_at | 2025-06-16 12:42:59.209887+00 |
| description | CBOR encoder and decoder |
| homepage | https://github.com/iamsauravsharma/cbor_next |
| repository | https://github.com/iamsauravsharma/cbor_next |
| max_upload_size | |
| id | 1711432 |
| size | 94,709 |
Library to encode and decode a Concise Binary Object Representation (CBOR)
| License | Crates Version | Docs |
|---|---|---|
DeterministicModeAdd cbor_next to your Cargo.toml
cbor_next = "0.3.0"
Main building block of library is DataItem Enum which represent a different type CBOR data item
use cbor_next::DataItem;
let value = DataItem::Unsigned(10_000_000);
let vector_data = vec![0x1a, 0x00, 0x98, 0x96, 0x80];
assert_eq!(value.encode(), vector_data);
use cbor_next::DataItem;
let vector_data = vec![0x1a, 0x00, 0x98, 0x96, 0x80];
let value = DataItem::Unsigned(10_000_000);
assert_eq!(DataItem::decode(&vector_data).unwrap(), value);
For other usage check out docs Value enum and its methods and functions