package multibase

  1. Overview
  2. Docs

Module MultibaseSource

Sourcemodule Encoding : sig ... end
Sourcemodule Base58 : sig ... end
Sourcemodule Base32 : sig ... end
Sourcetype 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
]
Sourcemodule type S = sig ... end
include S with type t := t
Sourceval encode_t : t -> string -> (string, [ `Msg of string ]) result

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

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

Similiar to encode_t except it may return `Unsupported kind

Sourceval 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.