Rendering a Byte Array as a Series of Hex Characters

You can use the BitConverter class to get a hex representation of a string of bytes.
For example:
1
2
3
4
byte[] someBytes = { 0x83, 0xDF, 0x0A, 0xA3, 0x92 };
 
string hex = BitConverter.ToString(someBytes);
Console.WriteLine(hex);
1015-001
Previous
Next Post »