hexstring

A library to encode to and decode from hexadecimal strings
README

An OCaml library to encode/decode hexadecimal strings.

Install with opam:

opam install hexstring

Add to your dune file:

(libraries hexstring)

Use as such:

(* you can encode bytes to an hexstring *)
b = Bytes.of_string "\x01\x02";;
s = Hexstring.encode b;; (* "0102" *)

(* you can also decode some hexstring, which returns a result of bytes *)
d = match Hexstring.decode s with
| Error err -> printf "error: %s\n"
| Ok b' -> assert b = b'
Install
Published
15 May 2021
Sources
hexstring-0.2.0.tbz
sha256=3683de3f80e97165e2e7c18b7371e37994af311ed90d2ab3d5f2a12300ab40ef
sha512=94da970fb7b4f006b89b892718d0039d0b2d6fd928da3fe93ba6d35b05815c49f0dd0626cc964e654b2dec1e134993006cd14f037d71ef98386e246b63aafe05
Dependencies
ppx_inline_test
>= "v0.14.1"
dune
>= "2.8"
ocaml
>= "4.07"
Reverse Dependencies