package multibase

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Encoding : sig ... end
module Base58 : sig ... end
module Base32 : sig ... end
type t = [
  1. | `Base32
  2. | `Base32hex
  3. | `Base32hexpad
  4. | `Base32hexupper
  5. | `Base32hexpadupper
  6. | `Base32pad
  7. | `Base32upper
  8. | `Base58btc
  9. | `Base58flickr
  10. | `Base64
  11. | `Base64pad
  12. | `Base64url
  13. | `Base64urlpad
]
module type S = sig ... end
include S with type t := t
val encode_t : t -> string -> (string, [ `Msg of string ]) result

encode_t kind s encodes s using base-encoding sheme kind.

val encode : Encoding.t -> string -> (string, [ `Msg of string | `Unsupported of Encoding.t ]) result

Similiar to encode_t except it may return `Unsupported kind

val decode : string -> (Encoding.t * string, [ `Msg of string | `Unsupported of Encoding.t ]) result

decode s will try to decode the multibase string s returning the encoding scheme and the decoded payload. It may be the case that we found a scheme we don't support.

OCaml

Innovation. Community. Security.