Args: inp (str): The encoded input. Returns: str: The decoded output.
(inp)
| 112 | """ |
| 113 | @staticmethod |
| 114 | def decode(inp): |
| 115 | """ |
| 116 | Args: |
| 117 | inp (str): The encoded input. |
| 118 | |
| 119 | Returns: |
| 120 | str: The decoded output. |
| 121 | """ |
| 122 | try: |
| 123 | inp = str(inp) |
| 124 | except Exception: |
| 125 | raise exceptions.InvalidDecodeInput |
| 126 | |
| 127 | outp = "" |
| 128 | # print(f"Encoding.decode({inp=})") |
| 129 | # This loops through a string like 'abCDefGHijKLmnOP' like so: l1+l2=ab, CD, ef, GH, etc. |
| 130 | for l1, l2 in zip(inp[::2], inp[1::2]): |
| 131 | outp += letters[int(l1 + l2)] |
| 132 | |
| 133 | return outp |
| 134 | |
| 135 | @staticmethod |
| 136 | def encode(inp): |
no outgoing calls
no test coverage detected