package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

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

doc/octez-libs.stdlib/Tezos_stdlib/Hex/index.html

Module Tezos_stdlib.HexSource

Sourcetype t = [
  1. | `Hex of string
]

Hexadecimal encoding.

TzHex defines hexadecimal encodings for characters, strings and Cstruct.t buffers.

The type var hexadecimal values.

Characters

Sourceval of_char : char -> char * char

of_char c is the the hexadecimal encoding of the character c.

Sourceval to_char : char -> char -> char option

to_char x y is the character corresponding to the xy hexadecimal encoding.

Returns None if x or y are not in the ranges '0'..'9', 'a'..'f', or 'A'..'F'.

Strings

Sourceval of_string : ?ignore:char list -> string -> t

of_string s is the hexadecimal representation of the binary string s. If ignore is set, skip the characters in the list when converting. Eg of_string ~ignore:[' '] "a f". The default value of ignore is []).

Sourceval to_string : t -> string option

to_string t is the binary string s such that of_string s is t.

Returns None if t contains a character that is not in the range '0'..'9', 'a'..'f', or 'A'..'F'.

Bytes

Sourceval of_bytes : ?ignore:char list -> bytes -> t

of_bytes s is the hexadecimal representation of the binary string s. If ignore is set, skip the characters in the list when converting. Eg of_bytes ~ignore:[' '] "a f". The default value of ignore is []).

Sourceval to_bytes : t -> bytes option

to_bytes t is the binary string s such that of_bytes s is t.

Returns None if t contains a character that is not in the range '0'..'9', 'a'..'f', or 'A'..'F'.

Sourceval to_bytes_exn : t -> bytes

to_bytes_exn t is the binary string s such that of_bytes s is t.

Debugging

Sourceval hexdump_s : ?print_row_numbers:bool -> ?print_chars:bool -> t -> string

Same as hexdump except returns a string.

Pretty printing

Sourceval pp : Format.formatter -> t -> unit

pp fmt t will output a human-readable hex representation of t to the formatter fmt.

Sourceval show : t -> string

show t will return a human-readable hex representation of t as a string.

OCaml

Innovation. Community. Security.