mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
12 lines
313 B
C#
12 lines
313 B
C#
|
|
namespace Serein.Proto.Modbus
|
|||
|
|
{
|
|||
|
|
public static class HexExtensions
|
|||
|
|
{
|
|||
|
|
public static string ToHexString(this byte[] data, string separator = " ")
|
|||
|
|
{
|
|||
|
|
if (data == null) return string.Empty;
|
|||
|
|
return BitConverter.ToString(data).Replace("-", separator);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|