Added function for converting data to hexadecimal string.