From 23b4ede93f8cb202ff0e85cef45921928ff6a94f Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Wed, 25 Mar 2020 15:31:57 +0100 Subject: Initial commit with working generator and corresponding tests --- otp2289/__init__.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 otp2289/__init__.py (limited to 'otp2289/__init__.py') diff --git a/otp2289/__init__.py b/otp2289/__init__.py new file mode 100644 index 0000000..d2f6386 --- /dev/null +++ b/otp2289/__init__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +"""A pure Python implementation of RFC-2289""" + +from .generator import (OTP_ALGO_MD5, + OTP_ALGO_SHA1, + OTPGenerator, + OTPGeneratorException) + + +__author__ = 'Simeon Simeonov' +__version__ = '1.0.0' +__license__ = 'GPL3' + + +def int_or_str(value): + """Returns int value of value when possible""" + try: + return int(value) + except ValueError: + return value + + +VERSION = tuple(map(int_or_str, __version__.split('.'))) + +__all__ = ['OTP_ALGO_MD5', + 'OTP_ALGO_SHA1', + 'OTPGenerator', + 'OTPGeneratorException'] -- cgit v1.3