diff options
| author | Simeon Simeonov | 2020-04-07 13:15:09 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2020-04-07 13:15:09 +0200 |
| commit | 719ad614ecb9e470fde7b54874a8da50df88519e (patch) | |
| tree | a93502147b07ee9feb44495fad3bd0a22dbe8e8b /otp2289/server.py | |
| parent | 49b1c3e2cfb9b0224712e6891a12950f725c3b13 (diff) | |
Add __repr__ for OTPState and OTPGenerator
Diffstat (limited to 'otp2289/server.py')
| -rw-r--r-- | otp2289/server.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/otp2289/server.py b/otp2289/server.py index 119fbff..7322727 100644 --- a/otp2289/server.py +++ b/otp2289/server.py | |||
| @@ -85,6 +85,13 @@ class OTPState: | |||
| 85 | self._current_digest = self.validate_hex(ot_hex) | 85 | self._current_digest = self.validate_hex(ot_hex) |
| 86 | self._new_digest_hex = None # set upon a successful validation | 86 | self._new_digest_hex = None # set upon a successful validation |
| 87 | 87 | ||
| 88 | def __repr__(self): | ||
| 89 | """repr implementation""" | ||
| 90 | return (f'{self.__class__} at {id(self)} ' | ||
| 91 | f'(ot_hex={self._current_digest}, current_step={self._step}, ' | ||
| 92 | f'seed={self._seed}, ' | ||
| 93 | f'hash_algo={self._hash_algo})') | ||
| 94 | |||
| 88 | @property | 95 | @property |
| 89 | def challenge_string(self): | 96 | def challenge_string(self): |
| 90 | """challenge_string-property""" | 97 | """challenge_string-property""" |
