Ejemplo n.º 1
0
        public static byte[] StringToBytes(string textInput)
        {
            if (string.IsNullOrEmpty(textInput))
            {
                return(null);
            }
            List <byte> bytes = new List <byte>();

            for (int i = 0; i < textInput.Length; i++)
            {
                bytes.Add(CharUtils.CharToByte(textInput[i]));
            }
            return(bytes.ToArray());
        }
Ejemplo n.º 2
0
 public static byte StringToByte(string input)
 {
     return(CharUtils.CharToByte(input[0]));
 }