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.1.tbz
sha256=ab05463895e15c91d47e5aa18be70f00e35bbb8ea7398707306483a7b3e82e20
sha512=a3e51514c5b36be8cc3aee23d41f67a361fbe218a17a9f7c8d0cb7448157ec700547173eba5325611ab4002c4716f709b6ea43c0f204a76702869e0cdd8ad052

Description

Published: 19 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.08"

Dev Dependencies

None

Used by

None

Conflicts

None