Add hex conversion to c code