From c2f78419b242df9a4872905d41332e5ea9fcfdb6 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Thu, 5 Jan 2023 17:00:35 +0100 Subject: Add the OTPState.ot_hex property --- src/otp2289/__init__.py | 4 ++-- src/otp2289/__main__.py | 2 +- src/otp2289/generator.py | 2 +- src/otp2289/server.py | 9 ++++++++- 4 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/otp2289/__init__.py b/src/otp2289/__init__.py index af8638c..4b600a0 100644 --- a/src/otp2289/__init__.py +++ b/src/otp2289/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # -# Copyright (c) 2020-2022 Simeon Simeonov +# Copyright (c) 2020-2023 Simeon Simeonov # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ from .server import ( ) __author__ = 'Simeon Simeonov' -__version__ = '1.1.1' +__version__ = '1.2.0' __license__ = 'BSD 2-Clause' diff --git a/src/otp2289/__main__.py b/src/otp2289/__main__.py index 78e60e8..d267b1b 100644 --- a/src/otp2289/__main__.py +++ b/src/otp2289/__main__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # -# Copyright (c) 2020-2022 Simeon Simeonov +# Copyright (c) 2020-2023 Simeon Simeonov # All rights reserved. # # Redistribution and use in source and binary forms, with or without diff --git a/src/otp2289/generator.py b/src/otp2289/generator.py index 7b86e1b..73ca18b 100644 --- a/src/otp2289/generator.py +++ b/src/otp2289/generator.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # -# Copyright (c) 2020-2022 Simeon Simeonov +# Copyright (c) 2020-2023 Simeon Simeonov # All rights reserved. # # Redistribution and use in source and binary forms, with or without 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 @@ # -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # -# Copyright (c) 2020-2022 Simeon Simeonov +# Copyright (c) 2020-2023 Simeon Simeonov # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -115,6 +115,13 @@ class OTPState: """hash_algo-property""" return self._hash_algo + @property + def ot_hex(self) -> str: + """ot_hex-property""" + if self._current_digest is None: + return '' + return binascii.hexlify(self._current_digest).decode() + @property def seed(self) -> str: """seed-property""" -- cgit v1.3