The Hex package exposes three functions
The first gives a hexadecimal representation of a Bytes, value, e.g.,
something like "6A45F2". The second takes a string like the one
just given and returns a value of type Maybe Bytes. Such a function
call can fail, e.g., on an input "6A45F!". The third is used
to "format" output into blocks.
Hex.toBytes "FF66" |> Maybe.map Hex.fromBytes == Just "FF66"
"abcdefhij" |> stringBlocks 3 ["abc","def","hij"]
Hex.toBytes "FF66" |> Maybe.map Hex.fromBytes == Just "FF66"