CID decoder
- class atproto_core.cid.CID(version: int | None = None, codec: int | None = None, hash: Multihash | None = None, _stringified_form: str | None = None, _raw_byte_form: bytes | None = None)
Bases:
objectContent Identifier.
Note
version, codec, and hash are decoded lazily on first access. Consumers that only compare or stringify CIDs (the CAR decoding path, for one) never pay for the multihash.
- classmethod from_decoded_bytes(value: bytes) CID
Wrap the binary form of a CID that the decoder it came from has already validated.
Skips the redundant
libipld.decode_cidcall thatCID.decodeperforms.
- property version: int
Get CID version.
- property codec: int
Get CID codec.
- property hash: Multihash
Get CID multihash.
- encode() str
- type CIDType
A
atproto_core.cid.CIDthat pydantic can validate and serialise. Accepts the string form on the wire.