package octez-proto-libs

  1. Overview
  2. Docs
Octez protocol libraries

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V8/Make/Base58/index.html

Module Make.Base58Source

type 'a encoding
Sourceval simple_decode : 'a encoding -> string -> 'a option

Decoder for a given kind of data. It returns None when the decoded data does not start with the expected prefix.

Sourceval simple_encode : 'a encoding -> 'a -> string

Encoder for a given kind of data.

type data = ..

An extensible sum-type for decoded data: one case per known "prefix". See for instance Hash.Block_hash.Hash or Environment.Ed25519.Public_key_hash.

val register_encoding : prefix:string -> length:int -> to_raw:('a -> string) -> of_raw:(string -> 'a option) -> wrap:('a -> data) -> 'a encoding

Register a new encoding. The function might raise Invalid_arg if the provided prefix overlaps with a previously registered prefix. The to_raw and of_raw are the ad-hoc serialisation/deserialisation for the data. The wrap should wrap the deserialised value into the extensible sum-type data (see the generic function decode).

val check_encoded_prefix : 'a encoding -> string -> int -> unit

Checks that an encoding has a certain prefix and length.

Sourceval decode : string -> data option

Generic decoder. It returns None when the decoded data does not start with a registered prefix.

OCaml

Innovation. Community. Security.