Self-describing content-addressed identifiers for distributed systems
Project description
CID (Content IDentifier)
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-packed 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'
Installation
Stable release
To install CID, run this command in your terminal:
$ pip install py-cid
This is the preferred method to install CID, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources
The sources for CID can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/ipld/py-cid
Or download the tarball:
$ curl -OL https://github.com/ipld/py-cid/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Supported Python versions
Python 3.4, 3.5, 3.6
Other info
Free software: MIT license
Documentation: https://py-cid.readthedocs.io.
History
0.1.0 (2017-09-05)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for py_cid-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71940a55ba31373a16ee77470e1670de2e4ada767771e24014502836e49322a9 |
|
MD5 | 67e1561bf0974091f3077b4b7c26cfc5 |
|
BLAKE2b-256 | 125d17835ae054fafe679f1abe4bf13d830af765cd682fc2e694c4e4690077a8 |