(self, hotp: bytes, counter: int)
| 76 | return "{0:0{1}}".format(hotp, self._length).encode() |
| 77 | |
| 78 | def verify(self, hotp: bytes, counter: int) -> None: |
| 79 | if not constant_time.bytes_eq(self.generate(counter), hotp): |
| 80 | raise InvalidToken("Supplied HOTP value does not match.") |
| 81 | |
| 82 | def _dynamic_truncate(self, counter: int) -> int: |
| 83 | ctx = hmac.HMAC(self._key, self._algorithm) |