(key)
| 47 | |
| 48 | |
| 49 | def init_table(key): |
| 50 | if key not in cached_tables: |
| 51 | encrypt_table = b''.join(get_table(key)) |
| 52 | decrypt_table = maketrans(encrypt_table, maketrans(b'', b'')) |
| 53 | cached_tables[key] = [encrypt_table, decrypt_table] |
| 54 | return cached_tables[key] |
| 55 | |
| 56 | |
| 57 | class TableCipher(object): |