summaryrefslogtreecommitdiff
path: root/otp2289/__init__.py
blob: d2f6386d712dc14db59acd4e39dae1e480281c27 (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
# -*- 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']