Say that I have a 4 character string, and I want to convert this string into a byte array where each character in the string is translated into its hex equivalent. e.g.
An alternative to get a byte array is to encode the string in ascii: b=s.encode('ascii').
b=s.encode('ascii')