package hexstring

  1. Overview
  2. Docs
A library to encode to and decode from hexadecimal strings

Install

Dune Dependency

Authors

Maintainers

Sources

hexstring-0.1.2.tbz
sha256=19bab75a06872b7610a4fbf258e47990eb94f50748ceaa4bdb6b9303e4cf560a
sha512=4b1dd93a27ac78f9ab579a94a3c83fbf9cbe69d57def9b60f3786b62cc578334b9c9f52ddbe7f1d30ee8844bcc92d9293c615a4af4debbfe5db409a5125c2293

doc/README.html

Hexstring

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'
OCaml

Innovation. Community. Security.