Source code for pycrypt.translators.asciitranslator

import translator
from .. import utils

[docs]class ASCIITranslator(translator.Translator): """Simple ASCII translation using unichr"""
[docs] def parseInput(self, cipher): return map(int, utils.split(str(cipher)))
[docs] def translate(self, cipher): return "".join([unichr(i) for i in self.parseInput(cipher)])
[docs] def encode(self, cipher): return " ".join([str(ord(i)) for i in cipher])