(key_list)
| 54 | # find best indices |
| 55 | # !!NEED TO BE IMPROVED!! |
| 56 | def find_best_indices(key_list): |
| 57 | n = maxlen(key_list) |
| 58 | seq = [x for x in range(0, n)] |
| 59 | for cnt in range(1, n + 1): |
| 60 | for comb in combination(seq, cnt): |
| 61 | test_set = set() |
| 62 | fail = False |
| 63 | for key in key_list: |
| 64 | comb_str = "" |
| 65 | for idx in comb: |
| 66 | comb_str += charat(key, idx) |
| 67 | if comb_str in test_set: |
| 68 | fail = True |
| 69 | break |
| 70 | test_set.add(comb_str) |
| 71 | if not fail: |
| 72 | print("*** Best indices found: " + str(comb)) |
| 73 | return comb |
| 74 | return None |
| 75 | |
| 76 | def keyhash(key, rand_table, idx_list, n): |
| 77 | ret = 0 |
no test coverage detected