>>> hill_cipher = HillCipher(np.array([[2, 5], [1, 6]])) >>> hill_cipher.replace_digits(19) 'T' >>> hill_cipher.replace_digits(26) '0' >>> hill_cipher.replace_digits(26.1) '0'
(self, num: int)
| 72 | return self.key_string.index(letter) |
| 73 | |
| 74 | def replace_digits(self, num: int) -> str: |
| 75 | """ |
| 76 | >>> hill_cipher = HillCipher(np.array([[2, 5], [1, 6]])) |
| 77 | >>> hill_cipher.replace_digits(19) |
| 78 | 'T' |
| 79 | >>> hill_cipher.replace_digits(26) |
| 80 | '0' |
| 81 | >>> hill_cipher.replace_digits(26.1) |
| 82 | '0' |
| 83 | """ |
| 84 | return self.key_string[int(num)] |
| 85 | |
| 86 | def check_determinant(self) -> None: |
| 87 | """ |