hex encode data