Skip to main content

Self-describing content-addressed identifiers for distributed systems

Project description

https://img.shields.io/pypi/v/py-cid.svg https://codecov.io/gh/ipld/py-cid/branch/master/graph/badge.svg Documentation Status

What is CID ?

CID is a format for referencing content in distributed information systems, like IPFS. It leverages content addressing, cryptographic hashing, and self-describing formats.

It is the core identifier used by IPFS and IPLD.

CID is a self-describing content-addressed identifier.

It uses cryptographic hashes to achieve content addressing.

It uses several multiformats to achieve flexible self-description, namely multihash for hashes, multicodec for data content types, and multibase to encode the CID itself into strings.

Sample Usage

>>> from cid import make_cid
>>> make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')
CIDv0(version=0, codec=dag-pb, multihash=b"\x12 \xb9M'\xb9\x93M>\x08\xa5.R\xd7\xda}\xab\xfa\xc4\x84..")

>>> cid = make_cid('QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4')
>>> print(cid.version, cid.codec, cid.multihash)

>>> print(cid.encode())
QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4

>>> str(cid)
'QmaozNR7DZHQK1ZcU9p7QdrshMvXqWK6gpu5rmrkPdT3L4'

Other info

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_cid-0.4.0.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_cid-0.4.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file py_cid-0.4.0.tar.gz.

File metadata

  • Download URL: py_cid-0.4.0.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for py_cid-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7c15d6a83f59c3a4c7fbff793f1d4cbfc831e90355fd0e2c5cfe927c21733cc3
MD5 db97b39dfb93a1329b7dd364d75fc074
BLAKE2b-256 e709c0ca25eac91c62f6f22f5ac6accd0bfa957e77adfdffd0eccc0700f2ea07

See more details on using hashes here.

File details

Details for the file py_cid-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: py_cid-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for py_cid-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a3183a3088b219dbf3cb37eec7d47a644be3f3ebabdf38347c2e9312621d6cc
MD5 234ef1f7d43ba02ef211a9cf63645ba6
BLAKE2b-256 8039d5c1828e79526002f1bf87b9daba01c7db445960daf341e1dd84a5ff0469

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page