Last active
January 2, 2023 23:10
-
-
Save jerhon/5cccbf76a65615da4e1dde08e8b719b4 to your computer and use it in GitHub Desktop.
Hex Operations in C#
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
public static class HexOps { | |
public static byte[] ToBytesFromHex(string hex) { | |
byte[] ret = new byte[hex.Length]; | |
for (int i = 0; i < hex.Length; i++) { | |
ret[i] = Convert.ToByte(hex[i]); | |
} | |
return ret; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment