DAG-CBOR

DAG-CBOR is a codec that implements the IPLD Data Model as a subset of CBOR, plus some additional constraints for hash consistent representations. DAG-CBOR also adds a “link” type using a CBOR tag, to bring it in line with the IPLD Data Model.

More info: https://ipld.io/docs/codecs/known/dag-cbor/

About CBOR: https://en.wikipedia.org/wiki/CBOR

atproto_core.cbor.decode_dag(data: bytes) dict

Decode and returns a single data item from the given data, with the DAG-CBOR codec.

Parameters:

data – The stream of bytes or bytes with DAG-CBOR data.

Returns:

Decoded DAG-CBOR.

Return type:

dict

atproto_core.cbor.decode_dag_multi(data: bytes) List[dict]

Decode and returns many data items from the given data, with the DAG-CBOR codec.

Parameters:

data – The stream of bytes or bytes with DAG-CBOR data.

Returns:

Decoded DAG-CBOR.

Return type:

list of dict