convert a string toBinary or toHex