MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / processText

Method processText

ciphers/hill_cipher.py:82–90  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

80 raise ValueError("discriminant modular {0} of encryption key({1}) is not co prime w.r.t {2}.\nTry another key.".format(req_l, det, req_l))
81
82 def processText(self, text):
83 text = list(text.upper())
84 text = [char for char in text if char in self.key_string]
85
86 last = text[-1]
87 while len(text) % self.break_key != 0:
88 text.append(last)
89
90 return ''.join(text)
91
92 def encrypt(self, text):
93 text = self.processText(text.upper())

Callers 2

encryptMethod · 0.95
decryptMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected