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.5.0.tar.gz (38.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.5.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for py_cid-0.5.0.tar.gz
Algorithm Hash digest
SHA256 93c62586c672353a9862f3fce13c9848ea39a00378e0980e2f0eed91631f3d28
MD5 899987fddbd5bcdd456db997d5909c4c
BLAKE2b-256 968e68c2bd0346247570e8e01e8c170a0237884e95cdfa43989527b71adaa978

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for py_cid-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fbad437384534e2a0ab0c4068aac3e510c4cb710c89c8f6bf98f4b07ed54e3e
MD5 4f9ca1c1489b8fafd39790d867b9d52b
BLAKE2b-256 2b18eaea1571ae8b4fa490793a4b78a9641c4579a884f7a26f3d1b019d7e91c2

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