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

Description

Published: 14 May 2021

README

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'

Dependencies (3)

  1. ppx_inline_test >= "v0.14.1"
  2. dune >= "2.8"
  3. ocaml >= "4.07"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.