Library
Module
Module type
Parameter
Class
Class type
Make a customized Proscript runtime that uses the mirage-crypto, mirage-crypto-ec and mirage-crypto-rng.lwt libraries.
You should use Make
unless you are unit testing or troubleshooting.
Since this is a highly unstable API, be sure to "include" DefaultOptions
in your custom options.
module Opts : CUSTOM_OPTIONS
The type that will be used to represent contiguous bytes; typically either Bytes.t or Cstruct.t
equal t_a t_b
is true if and only if the buffers t_a
and t_b
contain the same bytes
concat b_lst
take a list of buffers b_lst
, concatenates them together into one buffer
val of_string : string -> t
of_string s
converts a string s
into a buffer
of_elem_list elem_lst
concatenates a list of byte elements elem_lst
into a buffer
elem_at b i
gives the byte element at the zero-based position i
of buffer b
val char_of_elem : t_elem -> char
char_of_elem e
converts a byte element e
to a character (a byte)
val elem_of_char : char -> t_elem
elem_of_char c
convert a byte c
into a buffer element
val hexdump : t -> unit
hexdump_pp b
gives a thunk that pretty-prints the buffer b
to standard output
val hexdump_pp : Format.formatter -> t -> unit
hexdump_pp fmt b
gives a thunk that pretty-prints the buffer b
to the formatter fmt
val t_from_protobuf : Protobuf.Decoder.t -> t
t_from_protobuf d
reads the next value from the protobuf decoder d
and converts it into a buffer
val t_to_protobuf : t -> Protobuf.Encoder.t -> unit
t_to_protobuf b e
creates a thunk which will encode the buffer b
with the protobuf encoder e
when called
Conversions back and forth between various encodings like hexadecimal.
module Crypto : Dirsp_proscript.PROSCRIPT_CRYPTO with type t = t
Core cryptographic primitives like SHA-256.