Working with hex strings


I am currently working on HTTP/2 framing, and as part of the implementation i’d like to use test data defined at:

The payload in the test files is defined as a hex string. I was wondering if there is a library or something in the stdlib that can unhex the string like:

I figured i’d ask before starting to implement my own utility :slight_smile:


Hi! Is what you want?


Ah thank you! Your answer made me look at the docs again and turns out I just didn’t read it properly :expressionless:

I had missed the fact that it uses polymorphic variant to define the Hex.t type.

Initially I had assumed that there wasn’t a way to create a Hex.t from a string that was already hexadecimal.