def encode_duid(duid: DUID) -> str: """ Encode DUID as a string. :param duid: The DUID object :return: The string representing the DUID """ return codecs.encode(duid.save(), 'hex').decode('ascii')