Method

FromHex

Convert hex string to byte array.

string s="1234567890abcdef";
byte[] bytes=s.FromHex();
bytes

output:

index value
0 18
1 52
2 86
3 120
4 144
5 171
6 205
7 239

ToHex

Convert byte array to hex string.

bytes.ToHex()

output:

1234567890ABCDEF