コード例 #1
0
        public static void WriteHexa(this ChecksumEncoder encoder, string hexa)
        {
            hexa = hexa.Replace("-", string.Empty);

            byte[] bytes = Enumerable.Range(0, hexa.Length)
                           .Where(x => x % 2 == 0)
                           .Select(x => Convert.ToByte(hexa.Substring(x, 2), 16))
                           .ToArray();

            for (int i = 0; i < bytes.Length; i++)
            {
                encoder.WriteByte(bytes[i]);
            }
        }