Added function to get a hex string.