Using codecs module to convert to hex.