Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Cid
Sourceinclude S with type multihash = Cstruct.t Multihash_digestif.t
The type for multihashes
A content-addressed identifier.
val v :
version:[ `Cidv0 | `Cidv1 | `Cidv2 | `Cidv3 ] ->
base:Multibase.Encoding.t ->
codec:Multicodec.t ->
hash:multihash ->
t
Build a CID, this performs no checks on any of the inputs
The multibase encoding of the CID.
The multicodec type of the data
val of_string :
string ->
(t, [ `Msg of string | `Unsupported of Multibase.Encoding.t ]) result
of_string s
takes an encoded string s
that is the CID and pulls out each of the parts that make it up.
val of_cstruct :
base:Multibase.Encoding.t ->
Cstruct.t ->
(t, [ `Msg of string | `Unsupported of Multibase.Encoding.t ]) result
of_cstruct ~base buf
builds a value representing a CID. The buffer should not be encoded with the multibase encoding.
to_string t
converts the CID to a multibase encoded string. Errors happen if the base encoding is not supported. This may raise an exception of the base encoding format is not supported.
to_cstruct t
returns a buffer with the bytes corresponding to the unencoded CID.
Pretty-prints a CID.