Module ipns_entry::cbor
source · Expand description
CBOR serialization and deserialization for IPNS entries.
Example
use ipns_entry::cbor;
let value = "QmWEekX7EZLUd9VXRNMRXW3LXe4F6x7mB8oPxY5XLptrBq";
let validity = "2033-05-18T03:33:20.000000000Z";
let sequence = 0;
let ttl = 0;
let data = cbor::Data {
value: value.as_bytes().to_vec(),
validity: validity.as_bytes().to_vec(),
validity_type: 0,
sequence,
ttl,
}
.to_bytes();
// ...sign the data
Structs
Struct to hold the data to create the CBOR bytes.