From c8aa22f0bbce955b1be75ff966e526d3bbf64922 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Thu, 14 Mar 2024 13:14:34 +0100 Subject: [PATCH] minor --- README.md | 10 ++++++++++ ohex.mli | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e69de29..cbbe885 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,10 @@ +## oHEX + +This package with minimal dependency cone provides functionality to decode and +encode strings into hexadecimal representation. + +As example, `Ohex.decode "4142" = "AB"`. And `Ohex.encode "AB" = "4142"`. + +There's even the property, for all strings s: `Ohex.(decode (encode s)) = s`. + +A pretty-printer is provided as well. diff --git a/ohex.mli b/ohex.mli index cfd6f74..e7d409e 100644 --- a/ohex.mli +++ b/ohex.mli @@ -27,7 +27,9 @@ val decode_into : ?skip_whitespace:bool -> string -> bytes -> ?off:int -> unit val encode : string -> string (** [encode s] encodes [s] into a freshly allocated string of double size, where - each character in [s] is encoded as two hex digits in the returned string. *) + each character in [s] is encoded as two hex digits in the returned string. + An example: [encode "AB" = "4142"]. +*) val encode_into : string -> bytes -> ?off:int -> unit -> unit (** [encode_into s dst ~off ()] encodes [s] into [dst] starting at [off]