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

Class Encrypter

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

Source from the content-addressed store, hash-verified

171################################################################################
172
173class Encrypter(_Processor):
174
175 slots()
176
177 @staticmethod
178 def _run(data, cache_push, key, table, index):
179 index_pop, encode, index_push = index.popleft, key.encode, index.append
180 for char in data:
181 if char in table:
182 index_pop()
183 code = table[char]
184 cache_push(encode(index, code))
185 index_push(code)
186 else:
187 cache_push(char)
188
189################################################################################
190

Callers 2

encryptFunction · 0.70
auto_encryptFunction · 0.70

Calls 1

slotsFunction · 0.70

Tested by

no test coverage detected