| 171 | ################################################################################ |
| 172 | |
| 173 | class 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 |
no test coverage detected