Convert to/from hex string and array of bytes