namespace DemoApplication {
static void Main(string[] args) {
var bytes = HexToBytes(input);
string hex = us.ToString("x2");
Console.WriteLine($"{us} {hex} {string.Join("-", HexToBytes(hex))}");
bt[4] = HexToBytes(hex)[0];
bt[5] = HexToBytes(hex)[1];
string str2 = Encoding.ASCII.GetString(bt);
Console.WriteLine($"String is: {str2}");
static byte[] HexToBytes(string input)
byte[] result = new byte[input.Length / 2];
for(int i = 0; i < result.Length; i++)
result[i] = Convert.ToByte(input.Substring(2 * i, 2), 16);
public static class Crc16
const ushort polynomial = 0xA001;
static readonly ushort[] table = new ushort[256];
public static ushort ComputeChecksum(byte[] bytes)
for (int i = 0; i < bytes.Length; ++i)
byte index = (byte)(crc ^ bytes[i]);
crc = (ushort)((crc >> 8) ^ table[index]);
for (ushort i = 0; i < table.Length; ++i)
for (byte j = 0; j < 8; ++j)
if (((value ^ temp) & 0x0001) != 0)
value = (ushort)((value >> 1) ^ polynomial);