The Hex package exposes two 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!".
Hex.toBytes "FF66" |> Maybe.map Hex.fromBytes == Just "FF66"
Hex.toBytes "FF66" |> Maybe.map Hex.fromBytes == Just "FF66"