package hexstring

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

Install

Dune Dependency

Authors

Maintainers

Sources

hexstring-0.2.0.tbz
sha256=3683de3f80e97165e2e7c18b7371e37994af311ed90d2ab3d5f2a12300ab40ef
sha512=94da970fb7b4f006b89b892718d0039d0b2d6fd928da3fe93ba6d35b05815c49f0dd0626cc964e654b2dec1e134993006cd14f037d71ef98386e246b63aafe05

Description

Published: 15 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.