Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let hexToByte x =
match x with
| '0' -> 0uy
| '1' -> 1uy
| '2' -> 2uy
| '3' -> 3uy
| '4' -> 4uy
| '5' -> 5uy
| '6' -> 6uy
| '7' -> 7uy
| '8' -> 8uy
| '9' -> 9uy
| 'a' -> 10uy
| 'b' -> 11uy
| 'c' -> 12uy
| 'd' -> 13uy
| 'e' -> 14uy
| 'f' -> 15uy
| _ -> failwith "invalid char"
let hexToBytes (x: string ) =
String.iter : hexToByte x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.