<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hexdigest(self, data=None):
 """ Returns digest in the hexadecimal form. For compatibility with hashlib """

        from base64 import b16encode
        if pyver == 2:
            return b16encode(self.digest(data))
        else:
            return b16encode(self.digest(data)).decode('us-ascii')