converts number to hexadecimal or binary ascii representation and vice versa