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

Class Decrypter

recipes/Python/578135_Markov_EncryptiModule/recipe-578135.py:191–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189################################################################################
190
191class Decrypter(_Processor):
192
193 slots()
194
195 @staticmethod
196 def _run(data, cache_push, key, table, index):
197 index_pop, decode, index_push = index.popleft, key.decode, index.append
198 for char in data:
199 if char in table:
200 index_pop()
201 value = decode(index, table[char])
202 cache_push(value)
203 index_push(table[value])
204 else:
205 cache_push(char)
206
207################################################################################
208

Callers 1

decryptFunction · 0.70

Calls 1

slotsFunction · 0.70

Tested by

no test coverage detected