package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A functor for displaying a type as a sequence of ASCII characters printed in hexadecimal.

sexp_of_t and to_string_hum print t in a similar format to 'hexdump' on Unix systems. For example, the string "Back off, man, I'm a scientist." renders as:

00000000  42 61 63 6b 20 6f 66 66  2c 20 6d 61 6e 2c 20 49  |Back off, man, I|
00000010  27 6d 20 61 20 73 63 69  65 6e 74 69 73 74 2e     |'m a scientist.|

to_sequence produces a sequence of strings representing lines in the hex dump. It can be used to process a hex dump incrementally, for example with potentially infinite values, or to avoid keeping the entire output in memory at once.

module type S = Hexdump_intf.S
module type S1 = Hexdump_intf.S1
module type S2 = Hexdump_intf.S2

The functor Hexdump.Of_indexable uses length and get to iterate over the characters in a value and produce a hex dump.

OCaml

Innovation. Community. Security.