Created
November 13, 2016 15:29
-
-
Save wklm/56269dee40ead297c383a660d9cfdfc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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