diff options
| author | Simeon Simeonov | 2023-01-05 17:00:35 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2023-01-05 17:00:35 +0100 |
| commit | c2f78419b242df9a4872905d41332e5ea9fcfdb6 (patch) | |
| tree | fb096501c76db28c356cfacbf9f73a930c19ceeb /src/otp2289/server.py | |
| parent | 2c33e6214d3d607541656d4a5174c3553bfb085e (diff) | |
Add the OTPState.ot_hex property
Diffstat (limited to 'src/otp2289/server.py')
| -rw-r--r-- | src/otp2289/server.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/otp2289/server.py b/src/otp2289/server.py index 066cba2..4305f75 100644 --- a/src/otp2289/server.py +++ b/src/otp2289/server.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- |
| 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD | 2 | # SPDX-License-Identifier: BSD-2-Clause-FreeBSD |
| 3 | # | 3 | # |
| 4 | # Copyright (c) 2020-2022 Simeon Simeonov | 4 | # Copyright (c) 2020-2023 Simeon Simeonov |
| 5 | # All rights reserved. | 5 | # All rights reserved. |
| 6 | # | 6 | # |
| 7 | # Redistribution and use in source and binary forms, with or without | 7 | # Redistribution and use in source and binary forms, with or without |
| @@ -116,6 +116,13 @@ class OTPState: | |||
| 116 | return self._hash_algo | 116 | return self._hash_algo |
| 117 | 117 | ||
| 118 | @property | 118 | @property |
| 119 | def ot_hex(self) -> str: | ||
| 120 | """ot_hex-property""" | ||
| 121 | if self._current_digest is None: | ||
| 122 | return '' | ||
| 123 | return binascii.hexlify(self._current_digest).decode() | ||
| 124 | |||
| 125 | @property | ||
| 119 | def seed(self) -> str: | 126 | def seed(self) -> str: |
| 120 | """seed-property""" | 127 | """seed-property""" |
| 121 | return self._seed | 128 | return self._seed |
