package multicodec

  1. Overview
  2. Docs
Canonical codec of values and types used by various multiformats

Install

Dune Dependency

Authors

Maintainers

Sources

multicodec-0.1.0.tbz
sha256=56aeb4ea2d2a8a473c4d75a83e119bf1151636cd3f469ea29f179810e40b22cb
sha512=c933b19b437dc87e455b4b7e94f29953bc8b52bcb10f49dec4b614d9261560e6d7ce82a5b577ab99278238550b38f2e480d048339e868b592e9cf337fdf5ba29

Description

This library provides OCaml types and values for multicodec.

Published: 21 Oct 2022

README

ocaml-multicodec

This library provides OCaml values and types derived from the mutlicodec definition.

# #require "multicodec";;

Multicodec is an agreed upon codec table, essentially providing a means to encode some value as a number. For example, a number for hashes that are generated with SHA256.

# Multicodec.multihash_to_code;;
- : Multicodec.multihash -> int = <fun>
# Multicodec.multihash_to_code `Sha2_256;;
- : int = 18
# Multicodec.multihash_of_code 18;;
- : Multicodec.multihash option = Some `Sha2_256

Other encoded values include common addressing schemes, such as DNS.

# Multicodec.multiaddr_to_code `Dns;;
- : int = 53

Find out more about multicodec at the multiformats websites.

Dependencies (2)

  1. dune >= "2.9"
  2. ocaml >= "4.03.0"

Dev Dependencies (2)

  1. odoc with-doc
  2. mdx with-test

Used by (2)

  1. cid
  2. multihash

Conflicts

None

OCaml

Innovation. Community. Security.