MCPcopy Create free account
hub / github.com/ActiveState/code / encode

Method encode

recipes/Python/578076_Markov/recipe-578076.py:203–212  ·  view source on GitHub ↗

Encode the string and show the cipher-text in the output.

(self, string)

Source from the content-addressed store, hash-verified

201 # Encrypt a string for display in the interface's output area.
202
203 def encode(self, string):
204 "Encode the string and show the cipher-text in the output."
205 try:
206 cipher = self.build_cipher(string)
207 except ValueError:
208 self.output = ''
209 except:
210 self.output = traceback.format_exc()
211 else:
212 self.output = self.build_header() + '\n\n' + cipher
213
214 def build_cipher(self, string):
215 "Build cipher-text based on plain-text and return answer."

Callers 15

refreshMethod · 0.95
_process_COM_valueFunction · 0.45
encodeFunction · 0.45
decodeFunction · 0.45
encrypt_strFunction · 0.45
grid_sizeFunction · 0.45
decrypt_strFunction · 0.45
convertFunction · 0.45
__iter__Method · 0.45
get_sizeMethod · 0.45
_stringifyFunction · 0.45
save_actMethod · 0.45

Calls 2

build_cipherMethod · 0.95
build_headerMethod · 0.95

Tested by

no test coverage detected