Blog

[C#] C# で byte 列を16進数に変換したい

https://stackoverflow.com/questions/623104/byte-to-hex-string

の通りにやればいい。

byte[] data = { 1, 2, 4, 8, 16, 32 };
string hex = BitConverter.ToString(data);

// Result: 01-02-04-08-10-20

標準ライブラリでこういう表現できるのは便利だなーという感想。