Пример #1
0
        internal static byte[] DecodeHexString(string s)
        {
            string hexString = X509Utils.DiscardWhiteSpaces(s);
            uint   cbHex     = (uint)hexString.Length / 2;

            byte[] hex = new byte[cbHex];
            int    i   = 0;

            for (int index = 0; index < cbHex; index++)
            {
                hex[index] = (byte)((HexToByte(hexString[i]) << 4) | HexToByte(hexString[i + 1]));
                i         += 2;
            }
            return(hex);
        }