summaryrefslogtreecommitdiff
path: root/otp2289/__init__.py
blob: 82c1413aac43898dbdaf4dd413df7bc5dba2297f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
"""A pure Python implementation of RFC-2289"""

from .generator import (OTP_ALGO_MD5,
                        OTP_ALGO_SHA1,
                        OTPChallengeException,
                        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',
           'OTPChallengeException',
           'OTPGenerator',
           'OTPGeneratorException']