package hexen

All checked builds pass
  1. Overview
  2. Docs
Yet another library for encoding and decoding hexadecimal byte sequences

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.3.tar.gz
md5=0d7f6ad9a3d92ee8f730637eb5ac14f2
sha512=70421a8db4b9b1ca35b1898f74fd8e88950975c8ce5593fc7abf3d519bc759686f50c16444fdd25fb355cfc28bfdd67b20cd08b121ed41fc638cf72e04a4b57d

Description

Tags

hex hexadecimal

Added to opam-repository:

README

Hexen

Yet another library for encoding and decoding hexadecimal byte sequences.

Quick start

You can install hexen using the OPAM package manager or another method. If you are using Dune, add hexen to your dependencies.

In use

Hexen provides high-level functions like encode and decode for quick encoding and decoding of strings or substrings.

Hexen.encode "Hello World";;
(* - : string = "48656c6c6f20576f726c64" *)

Hexen.decode "48656c6c6f20576f726c64";;
(* - : string = "Hello World" *)
Hexen.encode_substring "Hello World" 0 5;;
(* - : string = "48656c6c6f" *)

Hexen.decode_substring "48656c6c6f20576f726c64" 0 10;;
(* - : string = "Hello" *)

Also, Hexen provides functions to encode and decode strings or substrings directly into existing buffers or bytes.

let buffer = Buffer.create 16 in

Hexen.encode_to_buffer buffer "Hello";
Hexen.encode_substring_to_buffer buffer "Hello World" 5 6;

let bytes = Bytes.create 12 in 
Hexen.decode_into (Buffer.contents buffer) 0 bytes 0 22;
Bytes.set bytes 11 '!';

bytes
(* - : bytes = Bytes.of_string "Hello World!" *)

Credits

This library was heavily inspired by the Ohex library and its codebase.

License

The project is licensed under the MIT License, which allows for all permissions. Just use it and enjoy yourself without fear. We are always open to pull requests!

Dependencies (2)

  1. ocaml >= "4.14"
  2. dune >= "3.6"

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test

Optional Dependencies

None

Used by (1)

  1. intel_hex >= "1.1"

Conflicts

None

Build status

Results of building hexen with each compiler on check.ci.ocaml.org, run of against opam-repository 6e2873f. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.3 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure