chk.cs

来自「指纹识别程序」· CS 代码 · 共 39 行

CS
39
字号
using System;
using System.Collections.Generic;
using System.Text;

namespace Fingerprint
{
    class CHK
    {

        public string GetCHK(string value)
        {

            //01 00 01 01 00
            string[] ByteStrings;
            ByteStrings = value.Split(" ".ToCharArray());
           
            int[] Bit = new int[5];



           

            for (int i = 0; i < ByteStrings.Length; i++)
            {
               
               Bit[i] = Convert.ToInt32(ByteStrings[i], 16);

            }

            int chk = Bit[0] ^ Bit[1] ^ Bit[2] ^ Bit[3] ^ Bit[4];

            byte[] c = new byte[1];
                c[0]= Convert.ToByte(chk);

            return HexCon.ByteToString(c);
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?