C#
[c#] hex를 byte로 변환하는 함수 (Hex to Byte)
moonsk
2019. 6. 6. 17:19
1
2
3
4
5
6
7
8
9
10
11
12
|
public static byte[] HexToByte(string hex)
{
byte[] convert = new byte[hex.Length / 2];
int length = convert.Length;
for (int i = 0; i < length; i++)
{
convert[i] = Convert.ToByte(hex.Substring(i * 2), 16);
}
return convert;
}
|
반응형