(byte[] ba)
| 5 | public class Utils { |
| 6 | |
| 7 | public static string ByteArrayToString(byte[] ba) { |
| 8 | StringBuilder hex = new StringBuilder(ba.Length * 2); |
| 9 | foreach (byte b in ba) |
| 10 | hex.AppendFormat("{0:x2}", b); |
| 11 | return hex.ToString(); |
| 12 | } |
| 13 | |
| 14 | public static string HexDump(byte[] bytes, int bytesPerLine = 16) { |
| 15 | if (bytes == null) return "<null>"; |