Characters
to_char x y is the character correspondong to the xy hexadecimal encoding.
Strings
val of_string : ?ignore:char list -> string -> tof_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 []).
val to_string : t -> stringto_string t is the binary string s such that of_string s is t.
Bytes
val of_bytes : ?ignore:char list -> bytes -> tof_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 []).
val to_bytes : t -> bytesto_bytes t is the binary string s such that of_bytes s is t.
Cstruct
of_cstruct buf is the hexadecimal representation of the buffer buf.
Bigstring
val of_bigstring : ?ignore:char list -> Cstruct.buffer -> tof_bigstring buf is the hexadecimal representation of the buffer buf.
val to_bigstring : t -> Cstruct.bufferto_bigstring t is the buffer b such that of_bigstring b is t.
Debugging
val hexdump : ?print_row_numbers:bool -> ?print_chars:bool -> t -> unithexdump h dumps the hex encoding to stdout in the following format:
       00000000: 6865 6c6c 6f20 776f 726c 6420 6865 6c6c  hello world hell
       00000010: 6f20 776f 726c 640a                      o world.This is the same format as emacs hexl-mode, and is a very similar format to hexdump -C. '\t' and '\n' are printed as '.'.in the char column.
print_row_numbers and print_chars both default to true. Setting either to false does not print the column.
val hexdump_s : ?print_row_numbers:bool -> ?print_chars:bool -> t -> stringSame as hexdump except returns a string.
Pretty printing
val pp : Stdlib.Format.formatter -> t -> unitpp fmt t will output a human-readable hex representation of t to the formatter fmt.
val show : t -> stringshow t will return a human-readable hex representation of t as a string.