package hexen
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Yet another library for encoding and decoding hexadecimal byte sequences
Install
dune-project
Dependency
Authors
Maintainers
Sources
0.2.tar.gz
md5=cfbc58c8b987ece6e41514a234adca48
sha512=511bad0c91cf0d9f9deb4060dd9fcc77ae47314eb3327277f042f223d47c46d66019893fd24c5bdea7d38b6a132a7e823da70a4337d634cbb103d292656473e0
Description
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!
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page