16 lines
551 B
Markdown
16 lines
551 B
Markdown
|
|
### ocaml-hex -- a minimal library providing hexadecimal converters
|
|||
|
|
|
|||
|
|
[](https://travis-ci.org/mirage/ocaml-hex)
|
|||
|
|
[](http://docs.mirage.io/hex/)
|
|||
|
|
|
|||
|
|
```ocaml
|
|||
|
|
# #require "hex";;
|
|||
|
|
# Hex.of_string "Hello world!";;
|
|||
|
|
- : Hex.t = `Hex "48656c6c6f20776f726c6421"
|
|||
|
|
# Hex.to_string (`Hex "deadbeef");;
|
|||
|
|
- : string = "ޭ<><DEAD>"
|
|||
|
|
# Hex.hexdump (Hex.of_string "Hello world!\n")
|
|||
|
|
00000000: 4865 6c6c 6f20 776f 726c 6421 0a Hello world!.
|
|||
|
|
- : unit = ()
|
|||
|
|
```
|