<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encrypt_ascii(self, data, key=None, v=None, extra_bytes=0, digest="hex"):
 """ Encrypt data and return as ascii string. Hexadecimal digest as default. Avaiable digests: hex: Hexadecimal base64: Base 64 hqx: hexbin4 """

        digests = {"hex": binascii.b2a_hex,
                   "base64": binascii.b2a_base64,
                   "hqx": binascii.b2a_hqx}
        digestor = digests.get(digest)
        if not digestor:
            TripleSecError(u"Digestor not supported.")

        binary_result = self.encrypt(data, key, v, extra_bytes)
        result = digestor(binary_result)
        return result